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 Tokens are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
access_token string true false The access token
agent_id integer true false The ID of the user this token authenticates as
client_identifier string true false The ID of the client this token belongs to
create_date string true false The time the token was created
expire_date string true false The refresh token, if generated
id integer true false The ID of the token. Automatically assigned when created
refresh_token string true false The refresh token, if generated
scopes string true false One or more allowed scopes for the client. Can be "read", "write", and "chat". See OAuth Authentication
token_type string true false Token type. Must be "Bearer"
Example
{
  "access_token": "L0m2pVzxYpiVZOnzuWfGTHJjUxMicmbsEeGh4QSBqTTaScnprJNC8DusW5RwFTuo",
  "agent_id": 100000204,
  "client_identifier": "zopim",
  "create_date": "2014-09-09T07:49:20Z",
  "expire_date": "2014-09-09T17:49:20Z",
  "id": 38,
  "refresh_token": "pLZYNfA082RVrUt6ArGiKroVrN6CS9ZJ2glbty5rA1CejmSVlGPk5GjfKarDR5VS",
  "scopes": "read write",
  "token_type": "Bearer"
}

List OAuth 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
Status 200 OK

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

Delete OAuth Token

  • DELETE /api/v2/oauth/tokens/{oauth_token_id}

Revokes the specified token.

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
oauth_token_id integer Path true The ID of the OAuth Token
Using curl
curl https://www.zopim.com/api/v2/oauth/tokens/{id} \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content