OAuth Tokens

You can use the API to list existing OAuth access tokens for the Zendesk Chat API, or to revoke them.

JSON Format

OAuth access tokens are represented as JSON objects with the following read-only attributes:

Name Type Description
id integer The ID of the token. Automatically assigned when created
agent_id integer The ID of the user this token authenticates as
client_identifier string The ID of the client this token belongs to
token_type string Token type. Must be Bearer
access_token string The access token
refresh_token string The refresh token, if generated
scopes string One or more allowed scopes for the client. Can be read, write, and chat. See OAuth Authentication
create_date date The time the token was created
expire_date date The refresh token, if generated

Example

 {
   "id": 38,
   "agent_id": 100000204,
   "client_identifier": "zopim",
   "token_type": "Bearer",
   "access_token": "L0m2pVzxYpiVZOnzuWfGTHJjUxMicmbsEeGh4QSBqTTaScnprJNC8DusW5RwFTuo",
   "refresh_token": "pLZYNfA082RVrUt6ArGiKroVrN6CS9ZJ2glbty5rA1CejmSVlGPk5GjfKarDR5VS",
   "scopes": "read write",
   "create_date": "2014-09-09T07:49:20Z",
   "expire_date": "2014-09-09T17:49:20Z"
 }

List Tokens

GET /api/v2/oauth/tokens

Lists all tokens under an agent.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/oauth/tokens \
  -v -u {email_address}:{password}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": 38,
    "agent_id": 100000204,
    "client_identifier": "zopim",
    ...
  },
  {
    "id": 143,
    "agent_id": 100000204,
    "client_identifier": "zendesk",
    ...
  },
  ...
]

Revoke Token

DELETE /api/v2/oauth/tokens/{id}

Revokes the specified token.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/oauth/tokens/{id} \
  -v -u {email_address}:{password} -X DELETE
Example Response
HTTP/1.1 204 OK
Content-Type: application/json