Skip to content

Authentication

Client Tokens

These tokens, only used by /Messages API, are public tokens which identify the target assistant.

Access Tokens

These are private tokens and allow the usage of Prisme.ai APIs with same permissions level as the Prisme.ai account from which they have been generated.

They also can be generated by API, using another access token or the session token from the browser, available in X-Parse-Session-Token header.

Generate an access token

Request example

curl --location --request POST 'https://api.prisme.ai/v2/auth/accessToken' \
--header 'X-Parse-Session-Token: SESSION_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "expiresAt": "2037-04-02T10:04:34.519Z"
}'

Response example

Code : 200

{
    "_id": "KYsrHNrAeR",
    // This is your access token
    "_session_token": "6989be62-7b3e-4569-88e1-481137f9bfb9",
    "_p_user": "xxx",
    "createdWith": {
        "action": "api",
        "authProvider": "sessionToken"
    },
    "restricted": false,
    "expiresAt": "2037-04-02T10:04:34.519Z",
    "_created_at": "2021-06-03T17:34:32.440Z",
    "_updated_at": "2021-06-03T17:34:32.440Z"
}  

List access tokens

Request example

curl --location --request GET 'https://api.prisme.ai/v2/auth/accessToken' \
--header 'X-Parse-Session-Token: SESSION_TOKEN' \

Response example

Code : 200

[
  {
      "_id": "KYsrHNrAeR",
      // This is your access token
      "_session_token": "6989be62-7b3e-4569-88e1-481137f9bfb9",
      "_p_user": "xxx",
      "createdWith": {
          "action": "api",
          "authProvider": "sessionToken"
      },
      "restricted": false,
      "expiresAt": "2037-04-02T10:04:34.519Z",
      "_created_at": "2021-06-03T17:34:32.440Z",
      "_updated_at": "2021-06-03T17:34:32.440Z"
  }    
]

Revoke an access token

Request example

curl --location --request DELETE 'https://api.prisme.ai/v2/auth/accessToken/ACCESS_TOKEN' \
--header 'X-Parse-Session-Token: SESSION_TOKEN' \

Response example

Code : 200