Twitter channel

Monitored Twitter handles represent the Twitter accounts that you have configured on your account to pull new tweets into Zendesk Support as tickets.

JSON Format

Monitored Twitter handles are represented in JSON with the below attributes

Name Type Read-only Mandatory Comment
id integer yes yes Automatically assigned upon creation
screen_name string yes yes The Twitter handle
twitter_user_id integer yes yes The country's code
created_at date yes no The time the handle was created
updated_at date yes no The time of the last update of the handle
avatar_url string yes no The profile image url of the handle
name string yes no The profile name of the handle
allow_reply boolean yes no If replies are allowed for this handle
can_reply boolean yes no If replies are allowed for this handle
Example
{
  "id":              211
  "screen_name":     "@zendesk",
  "twitter_user_id": 67462376832,
  "created_at":      "2009-05-13T00:07:08Z",
  "updated_at":      "2011-07-22T00:11:12Z"
}

Listing Monitored Twitter Handles

GET /api/v2/channels/twitter/monitored_twitter_handles.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/monitored_twitter_handles.json
Example Response
Status: 200 OK

{
  "monitored_twitter_handles": [
    {
      "id":              211
      "screen_name":     "@zendesk",
      "twitter_user_id": 67462376832,
      "created_at":      "2009-05-13T00:07:08Z",
      "updated_at":      "2011-07-22T00:11:12Z"
    },
    {
      "id":              431
      "screen_name":     "@zendeskops",
      "twitter_user_id": 67923318930,
      "created_at":      "2010-05-13T22:07:08Z",
      "updated_at":      "2011-07-22T00:15:19Z"
    }
  ]
}

Getting Monitored Twitter Handle

GET /api/v2/channels/twitter/monitored_twitter_handles/{id}.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/monitored_twitter_handles/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "monitored_twitter_handle": {
    {
      "id":              431
      "screen_name":     "@zendeskops",
      "twitter_user_id": 67923318930,
      "created_at":      "2010-05-13T22:07:08Z",
      "updated_at":      "2011-07-22T00:15:19Z"
    }
  }
}

Create Ticket from Tweet

POST /api/v2/channels/twitter/tickets.json

This end-point allows you to turn a tweet into a ticket. You must provide the tweet id as well as the id of a monitored twitter handle configured for your account.

Allowed For
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/tickets.json \
  -H "Content-Type: application/json" \
  -d '{"ticket": {"twitter_status_message_id": 8605426295771136, "monitored_twitter_handle_id": 45}}' \
  -v -u {email_address}:{password} -X POST

The submitter of the ticket is set to be the user submitting the API request.

Getting Twicket status

GET /api/v2/channels/twitter/tickets/{id}/statuses.json

Allowed For
  • Agents
Request Parameters

You can pass optional comment ids using the ids parameter to retrieve tweet information for only particular comments. i.e. ?ids=1,3,5

Using curl:
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/tickets/{id}/statuses.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "statuses": [
    {
      "id": 834, // Zendesk Support comment id
      "favorited": true,
      "user_followed": true,
      "retweeted": false
    },
    ...
  ]
}