X Channel

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

JSON format

Monitored X handles are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
allow_replybooleantruefalseIf replies are allowed for this handle
avatar_urlstringtruefalseThe profile image url of the handle
brand_idintegertruefalseWhat brand the handle is associated with
can_replybooleantruefalseIf replies are allowed for this handle
created_atstringtruefalseThe time the handle was created
idintegertruetrueAutomatically assigned upon creation
namestringtruefalseThe profile name of the handle
screen_namestringtruetrueThe X handle
twitter_user_idintegertruetrueThe country's code
updated_atstringtruefalseThe time of the last update of the handle

Example

{  "created_at": "2009-05-13T00:07:08Z",  "id": 211,  "screen_name": "@zendesk",  "twitter_user_id": 67462376832,  "updated_at": "2011-07-22T00:11:12Z"}

List Monitored X Handles

  • GET /api/v2/channels/twitter/monitored_twitter_handles

Allowed For

  • Admins
  • Agents

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/monitored_twitter_handles.json

Example response(s)

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

Show Monitored X Handle

  • GET /api/v2/channels/twitter/monitored_twitter_handles/{monitored_twitter_handle_id}

Allowed For

  • Admins
  • Agents

Parameters

NameTypeInRequiredDescription
monitored_twitter_handle_idintegerPathtrueThe ID of the custom agent role

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/monitored_twitter_handles/{monitored_twitter_handle_id}.json \  -v -u {email_address}:{password}

Example response(s)

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

Create Ticket from Tweet

  • POST /api/v2/channels/twitter/tickets

Turns a tweet into a ticket. You must provide the tweet id as well as the id of a monitored X (formerly Twitter) handle configured for your account.

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

Allowed For

  • Agents

Code Samples

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

Example response(s)

201 Created
// Status 201 Created
null

List Ticket statuses

  • GET /api/v2/channels/twitter/tickets/{comment_id}/statuses

Allowed For

  • Agents

Parameters

NameTypeInRequiredDescription
idsstringQueryfalseOptional comment ids to retrieve tweet information for only particular comments
comment_idintegerPathtrueThe ID of the comment

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/channels/twitter/tickets/{comment_id}/statuses.json \  -v -u {email_address}:{password}

Example response(s)

200 OK
// Status 200 OK
{  "statuses": [    {      "favorited": true,      "id": 834,      "retweeted": false,      "user_followed": true    }  ]}