Unable to get custom label from page conversations api

54 Views Asked by At

Fetched the Page conversation

GET /v18.0/<page_id>/conversations?fields=id,message_count,participants

We successfully got the participants along with the name and id (page scoped user id)

Error while making api call to get custom label

GET /v18.0/<user_psid>/custom_labels?fields=page_label_name&access_token=<PAGE_ACCESS_TOKEN>

{ "error": { "message": "Unsupported get request. Object with ID 'xxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", "type": "GraphMethodException", "code": 100, "error_subcode": 33, "fbtrace_id": "AacbMQx3cl5vIePPE6449iS" } }

We already have pages_messaging and pages_read_engagement permission approved. Does anyone know why we keep getting errors although all required permissions are approved?

2

There are 2 best solutions below

1
sonnv0812 On

You can try this request:

GET /v19.0/<user_psid>/custom_labels?access_token=<PAGE_ACCESS_TOKEN>

This endpoint doesn't have any parameters.

Source: https://developers.facebook.com/docs/graph-api/reference/v19.0/user/custom_labels

0
Usman Ashraf On

From the facebook graph api documentation: https://developers.facebook.com/docs/messenger-platform/identity/custom-labels/#retrieving_labels_by_psid

Currently, Messenger Platform do not support retrieving labels for Messenger accounts that were created using a phone number instead of a Facebook account.

This can be a possible culprit.