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 properties:

Name Type Read-only Mandatory Description
agent_id integer true false The ID of the agent who created the client
client_identifier string true false The identifier for this client
client_secret string true false The client secret. Generated automatically when created. Returned in full only during create and generate
client_type string false false Can be "public" (default) or "confidential". If you resave the client using the UI, reverts to "public"
company string false false The company name of the client
create_date string true false The time the client was created
id integer true false The ID of the client. Automatically assigned when created
name string false true The name of the client
redirect_uris false true A list of the valid redirect URIs for this client
scopes string false true Allowed scopes for this client. Only supports "read" or "write"
update_date string true false The time of the last update of the client

Example

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

List OAuth Clients

  • GET /api/v2/oauth/clients

Lists all clients under an agent.

Allowed for

  • Administrator

Using curl

curl https://www.zopim.com/api/v2/oauth/clients \  -v -u {email_address}:{password}

Example response(s)

200 OK
Status 200 OK
[  {    "agent_id": 100000203,    "client_identifier": "X0l3DNZexuASH7gvJOdmnXyS1Rv1w5ARjqXvlLzff3894hscYx",    "client_secret": "Ay0b5u23",    "client_type": "confidential",    "company": "zendesk",    "create_date": "2014-09-01T10:29:59Z",    "id": 1,    "name": "zendesk",    "redirect_uris": "http://localhost/redirect",    "scopes": "read",    "update_date": "2014-09-11T18:36:29Z"  },  {    "agent_id": 100000200,    "client_identifier": "yaFcvgPB1a9woOt5JKSkOXu6RI5iYPGJlQKinpsI3zx4ihwVR0",    "client_secret": "KmlUs0oM",    "client_type": "confidential",    "company": "zendesk",    "create_date": "2015-09-01T10:29:59Z",    "id": 2,    "name": "zopim",    "redirect_uris": "http://localhost/redirect",    "scopes": "read write",    "update_date": "2015-09-11T18:36:29Z"  }]

Show OAuth Client

  • GET /api/v2/oauth/clients/{oauth_client_id}

Shows detail of the specified client.

Allowed for

  • Administrator

Parameters

Name Type In Required Description
oauth_client_id integer Path true The ID of the OAuth Client

Using curl

curl https://www.zopim.com/api/v2/oauth/clients/{oauth_client_id} \  -v -u {email_address}:{password}

Example response(s)

200 OK
Status 200 OK
{  "agent_id": 100000200,  "client_identifier": "tN1UHkG2GrmbHkgiyn3WY80acJxebbmwPimLXeIdPDgn6TCBjgD0Bhhbx4iS604s",  "client_secret": "lRmLFvyD // truncated secret",  "client_type": "confidential",  "create_date": "2015-09-01T10:29:59Z",  "id": 3,  "name": "sunshine",  "redirect_uris": "http://localhost/redirect",  "scopes": "read write",  "update_date": "2015-09-11T18:36:29Z"}

Create OAuth Client

  • POST /api/v2/oauth/clients

Creates a new OAuth2 client.

Allowed for

  • Administrator

Using curl

curl https://www.zopim.com/api/v2/oauth/clients \  -d '{        "name": "client2", \        "company": "client2 company" \        "scopes": "read write", \        "redirect_uris": "{your_redirect_url}"      }' \  -v -u {email_address}:{password} \  -X POST -H "Content-Type: application/json"

Example response(s)

201 Created
Status 201 Created
{  "agent_id": 100000203,  "client_identifier": "5k6aN8tp4x53AQhRrki5UyqR271k7bhgp5tPkVXfXuFESd3XIi",  "client_secret": "ZptjrMFLAHx8846HS4astI4lcnTC0xeqScudHbuBl9fm9envuP1mUqDC5QJHVPn7 // full generated secret",  "client_type": "confidential",  "company": "client2 company",  "create_date": "2014-09-01T10:29:59Z",  "id": 256,  "name": "client2",  "redirect_uris": "{your_redirect_url}",  "scopes": "read write",  "update_date": null}

Update OAuth Client

  • PUT /api/v2/oauth/clients/{oauth_client_id}

Updates details of the specified client.

Allowed for

  • Administrator

Parameters

Name Type In Required Description
oauth_client_id integer Path true The ID of the OAuth Client

Using curl

curl https://www.zopim.com/api/v2/oauth/clients/{oauth_client_id} \  -d '{"name": "client two"}' \  -v -u {email_address}:{password} \  -X PUT -H "Content-Type: application/json"

Example response(s)

200 OK
Status 200 OK
{  "agent_id": 100000203,  "client_identifier": "5k6aN8tp4x53AQhRrki5UyqR271k7bhgp5tPkVXfXuFESd3XIi",  "client_secret": "ZptjrMFL // truncated secret",  "client_type": "confidential",  "company": "client2 company",  "create_date": "2014-09-01T10:29:59Z",  "id": 256,  "name": "client two",  "redirect_uris": "{your_redirect_url}",  "scopes": "read write",  "update_date": "2014-09-11T18:36:29Z"}

Delete OAuth Client

  • DELETE /api/v2/oauth/clients/{oauth_client_id}

Deletes the specified client.

Allowed for

  • Administrator

Parameters

Name Type In Required Description
oauth_client_id integer Path true The ID of the OAuth Client

Using curl

curl https://www.zopim.com/api/v2/oauth/clients/{oauth_client_id} \  -v -u {email_address}:{password} -X DELETE

Example response(s)

204 No Content
Status 204 No Content

Generate OAuth Client Secret

  • POST /api/v2/oauth/clients/{oauth_client_id}

Generates a new secret for the specified client.

Allowed for

  • Administrator

Parameters

Name Type In Required Description
oauth_client_id integer Path true The ID of the OAuth Client

Using curl

curl https://www.zopim.com/api/v2/oauth/clients/{oauth_client_id}/client_secret \-v -u {email_address}:{password} \-X POST -H "Content-Type: application/json"

Example response(s)

200 OK
Status 200 OK
{  "client_secret": "n0pvvn3Mrzt5JO88nTL7pHvrHcp3zI8K13eaP2ZGeLIudA9wUnGo0vQyhOFaiKnj // full generated secret"}