Rest API Login - Options

Show Options on how to login to OpenText © Content Server.

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)

OpenText Content Server Ticket
Example: 375959889....23cbe80

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)

OpenText Directory Service Ticket
Example: *OTDSSSO*AahBQlRBSURTTl...hkAAA*

Bearer Token

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)

Bearer Token
Example: eyJraWQiOiIwOGJiNTYzM...

Information

Login Options

Content Server Rest API
Use with Scripts / Postman

Rest API Login - get OTCSTicket

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

HTTP Methond

POST

Rest API Endpoint

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

Parameters

username=<username>
password=<pw>

Content-Type

or

Response

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

Information

Get OTCSTicket • Login with Username / Password

Content Server Rest API
Use with Scripts / Postman
OTCSTicket: OpenText specific HTTP Header to authorize Rest API requests
content-server: Hostname of Content Server
port: optional value for port (standard SSL = 443)
otcs-path: usually something like 'otcs/cs'
username: username to be used for login (must be url-encoded in case of x-www-form-urlencoded). Example:
OT_API
pw: password to be used for login (must be url-encoded in case of x-www-form-urlencoded). Example form-data:
s#cret
or url-encoded:
s%23cret

Rest API Login - get OTDSTicket

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

HTTP Methond

POST

Rest API Endpoint

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

Payload (raw)

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

Content-Type

application/json;charset=utf-8

Example

Response

{
    "token": "6F74647...",
    "user_id": "OT_API@Content Server Members",
    "ticket": "*OTDSSSO*AbhBQlFPMHhDbXo3QW...",
    "resourceID": null,
    "failureReason": null,
    "password_expiration_time": 0,
    "continuation": false,
    "continuationContext": null,
    "continuationData": null
}

Information

Get OTDSTicket • Login with Username / Password via OTDS

OpenText Directory Service Rest API
Use with Scripts / Postman
OTDSTicket: OpenText specific HTTP Header to authorize Rest API requests
directory-server: Hostname of OTDS Server
port: optional value for port (standard SSL = 443)
payload: JSON string with attributes user_name and password

Rest API Login - get Bearer Token

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

Prerequisite

Create an OAuth2 Client in OTDS: oauth2 client id and client secret is required.

HTTP Methond

POST

Rest API Endpoint

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

Authorization

Basic <base64String>

Example:
Basic T0FVVEhfQVBJOnMjY3JldA==

Parameters

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

Content-Type

application/x-www-form-urlencoded

Example

Response

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

Information

Get Bearer Token • Login with OAuth2 Client / Client Secret via OTDS

OpenText Directory Service Rest API
Use with Scripts / Postman
Bearer Token: HTTP Header to authorize Rest API requests
directory-server: Hostname of OTDS Server
port: optional value for port (standard SSL = 443)
base64String: Base64 encoded string with <OAuth2Client>:<ClientSecret>

Rest API - get a Node using OTCSTicket

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

HTTP Methond

GET

Rest API Endpoint

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

Parameters (Optional)

fields=properties%7Bid%2Cname%7D (properties{id,name})
fields=categories
fields=permissions
                    

HTTP Header (Auth)

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

Content-Type

Response

{
    "links": {...},
    "results": {
        "data": {
            "categories": [],
            "permissions": [],
            "properties": {
                "id": 2000,
                "name": "Enterprise"
            }
        }
    }
}

Information

Get Node Information • using OTCSTicket

Content Server Rest API
Use with Scripts / Postman
OTCSTicket: OpenText specific HTTP Header to authorize Rest API requests
content-server: Hostname of Content Server
port: optional value for port (standard SSL = 443)
otcs-path: usually something like 'otcs/cs'
parameters according to the OpenText Rest API documentation. Example:
fields=properties{id,name} (must be URL encoded)

Rest API - get a Node using OTDSTicket

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

HTTP Methond

GET

Rest API Endpoint

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

Parameters (Optional)

fields=properties%7Bid%2Cname%7D (properties{id,name})
fields=categories
fields=permissions
                    

HTTP Header (Auth)

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

Content-Type

Response

{
    "links": {...},
    "results": {
        "data": {
            "categories": [],
            "permissions": [],
            "properties": {
                "id": 2000,
                "name": "Enterprise"
            }
        }
    }
}

Information

Get Node Information • using OTDSTicket

Content Server Rest API
Use with Scripts / Postman
OTDSTicket: OpenText specific HTTP Header to authorize Rest API requests
content-server: Hostname of Content Server
port: optional value for port (standard SSL = 443)
otcs-path: usually something like 'otcs/cs'
parameters according to the OpenText Rest API documentation. Example:
fields=properties{id,name} (must be URL encoded)

Rest API - get a Node using Bearer Token

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

HTTP Methond

GET

Rest API Endpoint

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

Parameters (Optional)

fields=properties%7Bid%2Cname%7D (properties{id,name})
fields=categories
fields=permissions
                    

HTTP Header (Auth)

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

Content-Type

Response

{
    "links": {...},
    "results": {
        "data": {
            "categories": [],
            "permissions": [],
            "properties": {
                "id": 2000,
                "name": "Enterprise"
            }
        }
    }
}

Information

Get Node Information • using Bearer Token

Content Server Rest API
Use with Scripts / Postman
Bearer Token: get Bearer Token from Login
content-server: Hostname of Content Server
port: optional value for port (standard SSL = 443)
otcs-path: usually something like 'otcs/cs'
parameters according to the OpenText Rest API documentation. Example:
fields=properties{id,name} (must be URL encoded)