PeshZ
PeshZ

Reputation: 91

How to get custom label in page conversation via facebook graph api?

I want to get custom labels in page conversation via facebook graph api. I found out from here. https://developers.facebook.com/docs/graph-api/reference/v2.11/conversation

But I can not find. I want to know, Can facebook graph api get custom label in page conversation?

Upvotes: 1

Views: 1358

Answers (1)

Jay Dee
Jay Dee

Reputation: 91

Unfortunately Facebook only gives you labels applied to a user. So first you need the conversation participants and their user-ids, then you can get the labels associated with that user.

To get all the custom labels on a page

GET /v2.12/{page-id}/custom_labels (source)

Get the paticipants

GET /v2.12/{page-id}/conversations?fields=participants (source) You'll have to find which conversation you are looking for

or if you have the conversation id: GET /v2.12/{thread-id}?fields=participants

Get the labels

The participant id is the user-id. You can use the user-id to get the labels here:

GET /v2.12/{user-id}/custom_labels (source)

Upvotes: 1

Related Questions