Fields

Twitter User objects have the following fields and links:

Fields

field name description
handle this Twitter User's handle on Twitter
image_url link to this Twitter User's profile image
profile_url link to this Twitter User's profile
followers_count the number of followers this Twitter User had when it was last updated
verified whether or not this user is verified by Twitter
created_at when this record was created
updated_at when this record was last updated

Links

rel class embeddable? description
self twitter_user no this Twitter User
customer customer yes the Customer to which this Twitter User belongs

List

Retrieve a paginated list of all Twitter Users.

GET https://yoursite.desk.com/api/v2/twitter_users

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/twitter_users \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  "total_entries": 2,
  "page": 1,
  "_links": {
    "self": {
      "href": "/api/v2/twitter_users?page=1&per_page=50",
      "class": "page"
    },
    "first": {
      "href": "/api/v2/twitter_users?page=1&per_page=50",
      "class": "page"
    },
    "last": {
      "href": "/api/v2/twitter_users?page=1&per_page=50",
      "class": "page"
    },
    "next": null,
    "previous": null
  },
  "_embedded": {
    "entries": [
      {
        "handle": "desk_dev",
        "image_url": "http://example.com/image.png",
        "profile_url": "http://twitter.com/desk",
        "followers_count": "123",
        "verified": false,
        "created_at": "2017-06-01T20:10:44Z",
        "updated_at": "2017-06-01T20:10:44Z",
        "_links": {
          "self": {
            "href": "/api/v2/twitter_users/1",
            "class": "twitter_user"
          },
          "customer": {
            "href": "/api/v2/customers/1",
            "class": "customer"
          }
        }
      },
      {
        "handle": "desk",
        "image_url": "http://example.com/image.png",
        "profile_url": "http://twitter.com/desk",
        "followers_count": "123",
        "verified": false,
        "created_at": "2017-06-01T20:10:44Z",
        "updated_at": "2017-06-01T20:10:44Z",
        "_links": {
          "self": {
            "href": "/api/v2/twitter_users/2",
            "class": "twitter_user"
          },
          "customer": {
            "href": "/api/v2/customers/2",
            "class": "customer"
          }
        }
      }
    ]
  }
}

Show

Retrieve a single Twitter User.

GET https://yoursite.desk.com/api/v2/twitter_users/:id

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Example Curl Request

1
2
3
$ curl https://yoursite.desk.com/api/v2/twitter_users/:id \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "handle": "desk_dev",
  "image_url": "http://example.com/image.png",
  "profile_url": "http://twitter.com/desk",
  "followers_count": "123",
  "verified": false,
  "created_at": "2017-06-01T20:10:44Z",
  "updated_at": "2017-06-01T20:10:44Z",
  "_links": {
    "self": {
      "href": "/api/v2/twitter_users/1",
      "class": "twitter_user"
    },
    "customer": {
      "href": "/api/v2/customers/1",
      "class": "customer"
    }
  }
}

Create

Create a Twitter User.

POST https://yoursite.desk.com/api/v2/twitter_users

Applicable Roles

Agent, Reporting Agent, Workflow Manager, Knowledgebase Manager, Content Manager, Business Manager, Administrative Manager, Administrator, Knowledgebase Adminstrator, and Billing Administrator

Fields

field name description
handle this Twitter User's handle on Twitter

Links

name relation description
customer customer the customer to which this Twitter User belongs

Note: a given Twitter User must be associated with exactly one Customer

Example Curl Request

1
2
3
4
5
6
$ curl https://yoursite.desk.com/api/v2/twitter_users \
    -u email:password \
    -X POST \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"handle":"desk_dev","_links": { "customer": {"href": "/api/v2/customers/1","class": "customer"}}}'

Example Request Body

1
2
3
4
5
6
7
8
9
{
  "handle": "desk_dev",
  "_links": {
    "customer": {
      "href": "/api/v2/customers/1",
      "class": "customer"
    }
  }
}

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{
  "handle": "desk_dev",
  "image_url": "http://example.com/image.png",
  "profile_url": "http://twitter.com/desk",
  "followers_count": "123",
  "verified": false,
  "created_at": "2017-06-01T20:10:44Z",
  "updated_at": "2017-06-01T20:10:44Z",
  "_links": {
    "self": {
      "href": "/api/v2/twitter_users/1",
      "class": "twitter_user"
    },
    "customer": {
      "href": "/api/v2/customers/1",
      "class": "customer"
    }
  }
}