OAuth Clients

You can use this API to work with API clients for Zendesk Chat.

To create API clients using the Dashboard in Chat, see Adding an API client.

JSON Format

OAuth clients are represented as JSON objects with the following attributes:

Name Type Read-only Required Description
id integer yes no The ID of the client. Automatically assigned when created
name string no yes The name of the client
client_secret string yes no The client secret. Generated automatically when created and returned in full only at that time
client_type string no no Can be "public" (default) or "confidential". If you resave the client using the UI, reverts to "public"
redirect_uris string no yes A list of the valid redirect URIs for this client
scopes string no yes Allowed scopes for this client. Only supports read/write
agent_id integer yes no The ID of the agent who created the client
create_date date yes no The time the client was created
update_date date yes no The time of the last update of the client

Example

{
  "id": 1,
  "name": "client one",
  "client_secret": "Ay0b5u23pTuTyieXuXdoqb66xRDs1zaPEpunUD7MT4SXvx7ReWbOGPDTkinWpfgO",
  "client_identifier": "zopim",
  "client_type": "confidential",
  "redirect_uris": "http://localhost/redirect",
  "scopes": "read write",
  "agent_id": 100000201,
  "create_date": "2014-09-01T10:29:59Z",
  "update_date": "2014-09-11T18:36:29Z"
}

List Clients

GET /api/v2/oauth/clients

Lists all clients under an agent.

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

[
  {
    "id": 1,
    "name": "zendesk",
    ...
  },
  {
    "id": 2,
    "name": "zopim",
    ...
  },
  ...
]

Get Client

GET /api/v2/oauth/clients/{id}

Shows detail of the specified client.

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

{
  "id": 252,
  "name": "client1",
  "client_secret": "truncated, existing secret",
  ...
}

Create Client

POST /api/v2/oauth/clients

Creates a new OAuth2 client.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/oauth/clients \
  -d '{
        "name": "client2", \
        "scopes": "read write", \
        "redirect_uris": "{your_redirect_url}"
      }' \
  -v -u {email_address}:{password} \
  -X POST -H "Content-Type: application/json"
Example Response
HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": 256,
  "name": "client2",
  "client_secret": "full, generated secret",
  ...
}

Update Client

PUT /api/v2/oauth/clients/{id}

Updates details of the specified client.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/oauth/clients/{id} \
  -d '{"name": "client two"}' \
  -v -u {email_address}:{password} \
  -X PUT -H "Content-Type: application/json"
Example Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 256,
  "name": "client two",
  "client_secret": "truncated, existing secret",
  ...
}

Delete Client

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

Deletes the specified client.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/oauth/clients/{id} \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 204 No Content