i am trying to build a messenger/instagram chatbot but metas api/ access token system is very frustrating. i got the messenger one to work flawlessly but not the instagram i get the webhook payloads but the http request to send the respond isnt…i would appreciate any help since all tutorials on the internet are old and meta keeps updating everything
Welcome @BallistiX!
The Instagram send endpoint is different from Messenger - for Instagram DMs you need to POST to https://graph.facebook.com/v21.0/me/messages with the recipient’s IGSID (Instagram-scoped user ID), not the regular Facebook page-scoped ID. The body should look like:
{
"recipient": { "id": "{{$json.sender.id}}" },
"message": { "text": "{{$json.aiResponse}}" }
}
Also make sure your HTTP Request node uses your Page Access Token (not the app token) in the Authorization header as Bearer YOUR_PAGE_TOKEN, and that your app has the instagram_manage_messages permission approved. The most common reason the webhook works but the reply fails is either the wrong token scope or sending to the wrong recipient ID field from the payload.
thanks for your help man…i ended up using a face book graph api with a page access token and it worked. <3
