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

Name Type Read-only Mandatory Description
banned boolean false false Whether the visitor is currently banned or not
created string false false The create date for the visitor
email string false false The email ID of the visitor
external_id string true false The external ID of the visitor
id integer true false The ID of the visitor
name string false false The name to be displayed for the visitor
notes string true false Any additional notes about the visitor
phone string false false The phone number of the visitor (if available)
Example
{
  "banned": false,
  "created": "2014-09-01T10:29:59Z",
  "email": "[email protected]",
  "external_id": "john_extid",
  "id": 1,
  "name": "Visitor 1",
  "notes": "This visitor is really cool.",
  "phone": "+65 12345678"
}

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
Status 201 Created

{
  "banned": false,
  "created": "2014-09-01T10:29:59Z",
  "email": "[email protected]",
  "external_id": "john_extid",
  "id": 1,
  "name": "Visitor 1",
  "notes": "This visitor is really cool.",
  "phone": "+65 12345678"
}

Show Visitor

  • GET /api/v2/visitors/{visitor_id}

Fetches a visitor by his or her Visitor ID

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
visitor_id integer Path true The ID of the visitor
Using curl
curl https://www.zopim.com/api/v2/visitors/(visitor_id) \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "banned": false,
  "created": "2014-09-01T10:29:59Z",
  "email": "[email protected]",
  "external_id": "john_extid",
  "id": 1,
  "name": "Visitor 1",
  "notes": "This visitor is really cool.",
  "phone": "+65 12345678"
}

Update Visitor

  • PUT /api/v2/visitors/{visitor_id}

Allows an account owner/admin to update details of visitor.

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
visitor_id integer Path true The ID of the visitor
Using curl
curl https://www.zopim.com/api/v2/visitors/{visitor_id} \
  -d '{"name": "John"}' \
  -v -u {email_address}:{password} \
  -X PUT -H "Content-Type: application/json"
Example Response
Status 200 OK

{
  "banned": false,
  "created": "2014-09-01T10:29:59Z",
  "email": "[email protected]",
  "external_id": "john_extid",
  "id": 1,
  "name": "John",
  "notes": "This visitor is really cool.",
  "phone": "+65 12345678"
}