Fields

Facebook Feed objects have the following fields and links:

Fields

field name description
id id for this Facebook Feed
name name for this Facebook Feed
image_url link to this Facebook Feed's Facebook image
profile_url link to this Facebook Feed's Facebook profile
created_at when this record was created
updated_at when this record was last updated

Links

rel class embeddable? description
self facebook_feed no this Facebook Feed

List

Retrieve a paginated list of all Facebook Feeds.

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

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/facebook_feeds \
    -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
{
  "total_entries": 2,
  "page": 1,
  "_links": {
    "self": {
      "href": "/api/v2/facebook_feeds?page=1&per_page=50",
      "class": "page"
    },
    "first": {
      "href": "/api/v2/facebook_feeds?page=1&per_page=50",
      "class": "page"
    },
    "last": {
      "href": "/api/v2/facebook_feeds?page=1&per_page=50",
      "class": "page"
    },
    "next": null,
    "previous": null
  },
  "_embedded": {
    "entries": [
      {
        "image_url": "https://graph.facebook.com/desk-support/picture?type=square",
        "profile_url": "https://www.facebook.com/desk-support",
        "created_at": "2016-09-12T16:16:17Z",
        "updated_at": "2016-09-17T16:16:17Z",
        "_links": {
          "self": {
            "href": "/api/v2/facebook_feeds/1",
            "class": "facebook_feed"
          }
        }
      },
      {
        "image_url": "https://example.com/facebook_feed_image",
        "profile_url": "https://example.com/facebook_feed_profile",
        "created_at": "2016-09-12T16:16:17Z",
        "updated_at": "2016-09-17T16:16:17Z",
        "_links": {
          "self": {
            "href": "/api/v2/facebook_feeds/2",
            "class": "facebook_feed"
          }
        }
      }
    ]
  }
}

Show

Retrieve a single Facebook Feed.

GET https://yoursite.desk.com/api/v2/facebook_feeds/: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/facebook_feeds/:id \
    -u email:password \
    -H 'Accept: application/json'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "image_url": "https://graph.facebook.com/desk-support/picture?type=square",
  "profile_url": "https://www.facebook.com/desk-support",
  "created_at": "2016-09-12T16:16:17Z",
  "updated_at": "2016-09-17T16:16:17Z",
  "_links": {
    "self": {
      "href": "/api/v2/facebook_feeds/1",
      "class": "facebook_feed"
    }
  }
}

Update Facebook Post

Update a facebook post for a facebook feed unrelated to a case. You can only perform actions on sent facebook posts.

Applicable Roles

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

Common Fields

field name description
action_type Perform an action on a sent facebook post. Can be like or unlike.

Example Curl Request

1
2
3
4
5
6
$ curl https://yoursite.desk.com/api/v2/facebook_feeds/:facebook_feed_id/facebook_posts \
    -u email:password \
    -X POST \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"action_type":"like"}'

Example Request Body

1
2
3
{
  "action_type": "like"
}

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
{
  "body": "This is a facebook post, for all our customers.",
  "direction": "out",
  "created_at": "2016-09-22T16:06:17Z",
  "updated_at": "2016-09-22T16:06:17Z",
  "erased_at": "2016-09-22T16:06:17Z",
  "status": "draft",
  "from_facebook_name": "name",
  "liked": "true",
  "_links": {
    "self": {
      "href": "/api/v2/facebook_feeds/1/facebook_posts/1",
      "class": "facebook_post"
    },
    "case": {
      "href": "/api/v2/cases/1",
      "class": "case"
    },
    "customer": {
      "href": "/api/v2/customers/1",
      "class": "customer"
    },
    "sent_by": {
      "href": "/api/v2/users/2",
      "class": "user"
    },
    "erased_by": {
      "href": "/api/v2/users/3",
      "class": "user"
    }
  }
}

Create Facebook Post

Create a facebook post for a facebook feed unrelated to a case.

Applicable Roles

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

Common Fields

field name description
body Body of the reply.
direction out.

Example Curl Request

1
2
3
4
5
$ curl https://yoursite.desk.com/api/v2/facebook_feeds/:facebook_feed_id/facebook_posts \
    -u email:password \
    -X POST \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'

Example Request Body

1
2
3
{
  "body": "This is a facebook post, for all our customers."
}

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
{
  "body": "This is a facebook post, for all our customers.",
  "direction": "out",
  "created_at": "2016-09-22T16:06:17Z",
  "updated_at": "2016-09-22T16:06:17Z",
  "erased_at": "2016-09-22T16:06:17Z",
  "status": "draft",
  "from_facebook_name": "name",
  "liked": "false",
  "_links": {
    "self": {
      "href": "/api/v2/facebook_feeds/1/facebook_posts/1",
      "class": "facebook_post"
    },
    "case": {
      "href": "/api/v2/cases/1",
      "class": "case"
    },
    "customer": {
      "href": "/api/v2/customers/1",
      "class": "customer"
    },
    "sent_by": {
      "href": "/api/v2/users/2",
      "class": "user"
    },
    "erased_by": {
      "href": "/api/v2/users/3",
      "class": "user"
    }
  }
}

Facebook Likes List

Retrieve a list of all likes for this Facebook post and any comments.

GET https://yoursite.desk.com/api/v2/facebook_feeds/:facebook_feed_id/facebook_posts/:facebook_post_id/likes

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/facebook_feeds/:facebook_feed_id/facebook_posts/:facebook_post_id/likes \
    -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
{
  "entries": [
    {
      "facebook_id": "1234_5678",
      "liked_by_page": false,
      "like_count": 0
    },
    {
      "facebook_id": "1234_5678_9012",
      "liked_by_page": true,
      "like_count": 1
    }
  ],
  "_links": {
    "self": {
      "href": "https://yoursite.desk.com/api/v2/facebook_feeds/4/facebook_posts/9/likes",
      "class": "facebook_likes"
    }
  }
}