Visitors
If you are participating in the Zendesk messaging beta, some Chat APIs are not supported. See How Zendesk messaging impacts Chat APIs for more information.
You can use the API to get or set Visitor information.
JSON Format
Visitors are represented as JSON objects with the following attributes.
Name | Type | Read-only | Description |
---|---|---|---|
id | integer | yes | The ID of the visitor |
name | string | no | The name to be displayed for the visitor |
created | timestamp | no | The create date for the visitor |
no | The email ID of the visitor | ||
banned | boolean | no | Whether the visitor is currently banned or not |
notes | string | yes | Any additional notes about the visitor |
phone | string | no | The phone number of the visitor (if available) |
external_id | string | yes | The external ID of the visitor |
Get a Visitor
GET /api/v2/visitors/{visitor_id}
Fetches a visitor by his or her Visitor ID
Allowed for
- Owner
- Administrator
Using cURL
curl https://www.zopim.com/api/v2/visitors/(visitor_id) \
-v -u {email_address}:{password}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "Visitor 1",
"email": "[email protected]",
"created": "2014-09-01T10:29:59Z",
"banned": false,
"notes": "This visitor is really cool.",
"phone": "+65 12345678",
"external_id": "john_extid"
}
Create Visitor
POST /api/v2/visitors
Allows the account owner/administrator to add more visitors
Allowed for
- Owner
- Administrator
Using cURL
curl https://www.zopim.com/api/v2/visitors \
-d '{
"name": "Visitor 1",
"email": "[email protected]",
"notes": "This visitor is really cool.",
"phone": "+65 12345678"
}' \
-v -u {email_address}:{password} \
-X POST -H "Content-Type: application/json"
Example Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"id":1,
"name":"Visitor 1",
...
}
Update Visitor
PUT /api/v2/visitors/{visitor_id}
Allows an account owner/admin to update details of visitor.
Allowed for
- Owner
- Administrator
Using cURL
curl https://www.zopim.com/api/v2/visitors/{visitor_id} \
-d '{"display_name": "John"}' \
-v -u {email_address}:{password}
-X PUT -H "Content-Type: application/json"
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":1,
"name":"John",
...
}