← Zurück zur Übersicht
🔌

Rest API Examples

Comprehensive guide and examples for interacting with the OpenText Content Server REST API.

Authentication

To access the API, valid authentication is required. Below are the common methods supported by xECM.

Rest API Login - Options

  • Content Server REST API (OTCSTicket)
    • Advantage: only 1 URL is used to login and call RestAPI
    • Disadvantage: Dialog User is used (credentials could be used to login via browser)
    • Example Ticket: 375959889....23cbe80
  • OpenText Directory Service Ticket (OTDSTicket)
    • Advantage: Ticket can be used to also call other resources than Content Server RestAPI
    • Disadvantage: Dialog User is used (credentials could be used to login via browser)
    • Example Ticket: *OTDSSSO*AahBQlRBSURTTl...hkAAA*
  • Bearer Token (OAuth2)
    • Advantage: Auth Client instead of dialog User is used (credentials can NOT be used to login via browser)
    • Disadvantage: Token is created in OTDS, but call is done to RestAPI of Content Server (2 different URLs)
    • Example Token: eyJraWQiOiIwOGJiNTYzM...

Rest API Login - get OTCSTicket

How to login with Username / Password to OpenText © Content Server.

POST http[s]://<content-server>:<port>/<otcs-path>/api/v1/auth
Example: https://otcs.phil.local/otcs/cs/api/v1/auth

Body (form-data or x-www-form-urlencoded):
username=<username>
password=<pw>

Response:
{ "ticket": "3bf4f1883f3e....35c0dd83" }

Rest API Login - get OTDSTicket

How to login with Username / Password to Content Server via OpenText © Directory Service.

POST http[s]://<directory-server>:<port>/otdsws/v1/authentication/credentials
Example: https://otds.phil.local/otdsws/v1/authentication/credentials

Headers:
Content-Type: application/json;charset=utf-8

Body:
{ "user_name": "<username>", "password": "<pw>" }

Response:
{ "token": "6F74647...", "ticket": "*OTDSSSO*AbhBQlFPMHhDbXo3QW..." ... }

Rest API Login - get Bearer Token

How to login with OAuth2 Client / Client Secret to Content Server via OpenText © Directory Service.

POST http[s]://<directory-server>:<port>/otdsws/oauth2/token
Example: https://otds.phil.local/otdsws/oauth2/token

Headers:
Authorization: Basic <base64String> (Example: Basic T0FVVEhfQVBJOnMjY3JldA==)
Content-Type: application/x-www-form-urlencoded

Body:
grant_type=client_credentials
requested_token_type=urn:ietf:params:oauth:token-type:access_token

Response:
{ "access_token": "eyJraWQi...bOw", "token_type": "Bearer", "expires_in": 86400 }

Download Postman Example (xecm-otds-oauth2)

Get Node Information

Retrieve metadata, categories, and permissions for specific nodes.

Rest API - get a Node using OTCSTicket

How to get a Node via the API of OpenText © Content Server.

GET http[s]://<content-server>:<port>/<otcs-path>/api/v2/nodes/<nodeid>
Example: https://otcs.phil.local/otcs/cs/api/v2/nodes/2000

Query Params:
fields=properties{id,name}
fields=categories
fields=permissions

Headers:
OTCSTicket: f87a0cad72...9a42ebe8bdaea
Content-Type: application/json;charset=utf-8

Response:
{ "results": { "data": { "properties": { "id": 2000, "name": "Enterprise" } ... } } }

Download Postman Example (xecm-get-node-otcsticket)

Rest API - get a Node using OTDSTicket

How to get a Node via the API of OpenText © Content Server using OTDSTicket.

GET http[s]://<content-server>:<port>/<otcs-path>/api/v2/nodes/<nodeid>

Headers:
OTDSTicket: *OTDSSSO*AbxBQlM4Q...qTBmb_7rqgMi0AAA**
Content-Type: application/json;charset=utf-8

Download Postman Example (xecm-get-node-otdsticket)

Rest API - get a Node using Bearer Token

How to get a Node via the API of OpenText © Content Server using OAuth2 Bearer Token.

GET http[s]://<content-server>:<port>/<otcs-path>/api/v2/nodes/<nodeid>

Headers:
Authorization: Bearer ey...
Content-Type: application/json;charset=utf-8

Download Postman Example (xecm-get-node-bearer-token)