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 properties:
Name | Type | Read-only | Mandatory | Description |
---|---|---|---|---|
agent_id | integer | true | false | The ID of the agent who created the client |
client_identifier | string | false | false | The identifier for this client |
client_secret | string | true | false | The client secret. Generated automatically when created and returned in full only at that time |
client_type | string | false | false | Can be "public" (default) or "confidential". If you resave the client using the UI, reverts to "public" |
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 | false | The name of the client |
redirect_uris | false | false | A list of the valid redirect URIs for this client | |
scopes | string | false | false | 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": "zopim",
"client_secret": "Ay0b5u23pTuTyieXuXdoqb66xRDs1zaPEpunUD7MT4SXvx7ReWbOGPDTkinWpfgO",
"client_type": "confidential",
"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
Status 200 OK
[
{
"agent_id": 100000203,
"client_identifier": "zendesk",
"client_secret": "Ay0b5u23adededuXdoqb66xRDs1zaPEpunUD7MT4SXvx7ReWbOGPDTkinWpfgO",
"client_type": "confidential",
"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": "zopim",
"client_secret": "Ay0b5u234343feXdoqb66xRDs1zaPEpunUD7MT4SXvx7ReWbOGPDTkinWpfgO",
"client_type": "confidential",
"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/{id} \
-v -u {email_address}:{password}
Example Response
Status 200 OK
{
"agent_id": 100000200,
"client_identifier": "sunshine",
"client_secret": "Ay0b5u234343feXdoqb66xRDs1zaPEpunUD7MT4SXvx7ReWbOGPDTkinWpfgO",
"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", \
"scopes": "read write", \
"redirect_uris": "{your_redirect_url}"
}' \
-v -u {email_address}:{password} \
-X POST -H "Content-Type: application/json"
Example Response
Status 201 Created
{
"agent_id": 100000203,
"client_identifier": "1234",
"client_secret": "full, generated secret",
"client_type": "confidential",
"create_date": "2014-09-01T10:29:59Z",
"id": 256,
"name": "client2",
"redirect_uris": "{your_redirect_url}",
"scopes": "read write",
"update_date": "2014-09-11T18:36:29Z"
}
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/{id} \
-d '{"name": "client two"}' \
-v -u {email_address}:{password} \
-X PUT -H "Content-Type: application/json"
Example Response
Status 200 OK
{
"agent_id": 100000203,
"client_identifier": "1234",
"client_secret": "full, generated secret",
"client_type": "confidential",
"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/{id} \
-v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content