MESSAGING task on the Pageinstagram_basicinstagram_manage_commentsinstagram_manage_messagespages_messagingimage (which include GIFs), video, audio, or file| Media Type | Supported Format | Supported Size Maximum |
|---|---|---|
Audio | acc, m4a, wav, mp4 | 25MB |
Image | png, jpeg, gif | 8MB |
Video | mp4, ogg, avi, mov, webm | 25MB |
File | pdf | 25MB |
POST request to the /<PAGE_ID>/message_attachments endpoint with the platform set as Instagram and the message attachment type set to the type of media you are uploading, audio, image, video or file. Add the URL and is_reusable in the payload. Set is_reusable to true so that the media can be used in multiple messages.message object, such as attachment, type, and payload are strings.curl "https://graph.facebook.com/<LATEST-API-VERSION>/<PAGE_ID>/message_attachments" -H "Content-Type: application/json" -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>" -d '{ "platform":"instagram", "message": { "attachment": { "type": "<MEDIA_TYPE>", "payload": { "url": "<MEDIA_URL>", "is_reusable": "true", }, } } }'
POST request to the /<PAGE_ID>/message_attachments endpoint with the message attachment payload containing the URL and the platform set to instagram. If you want to use the media in multiple messages, include the is_reusable set to true in the payload.curl "https://graph.facebook.com/<LATEST-API-VERSION>/<PAGE_ID>/message_attachments" -H "Content-Type: application/json" -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>" -d '{ "platform":"instagram", "filedata":"<FILE_PATH>;type=<PATH_TYPE>", "message": { "attachment": { "type": "<MEDIA_TYPE>", "is_reusable": "true", } } }'
{ "attachment_id": "<ATTACHMENT_ID>" }
POST request to the /<PAGE_ID>/messages endpoint with the recipient parameter containing the Instagram-scoped ID (IGSID) and the message parameter containing an attachment object with the type set to MEDIA_SHARE and payload.id set to the attachment ID.curl "https://graph.facebook.com/<LATEST-API-VERSION>/<PAGE_ID>/messages" -H "Content-Type: application/json" -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>" -d '{ "recipient": { "id":"<IGSID>" }, "message": { "attachment": { "type": "MEDIA_SHARE", "payload": { "attachment_id":"<ATTACHMENT_ID>" } } } }'
{ "recipient_id": "<IGSID>", "message_id": "<MESSAGE_ID>" }
POST request to the /<PAGE_ID>/messages endpoint with the recipient parameter containing the Instagram-scoped ID (IGSID) and the message parameter containing an attachment object with the type set to audio, image, video or file and payload containing the URL and is_reusable set to true.curl "https://graph.facebook.com/<LATEST-API-VERSION>/<PAGE_ID>/messages" -H "Content-Type: application/json" -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>" -d '{ "recipient": { "id":"<IGSID>" }, "message": { "attachment": { "type":"<MEDIA_TYPE>", "payload": { "url":"<URL_TO_MEDIA>" }, "is_reusable": "true", } } }'
POST request to the /<PAGE_ID>/messages endpoint with the recipient parameter containing the Instagram-scoped ID (IGSID) and the message parameter containing an attachment object with the type set to AUDIO, IMAGE, VIDEO or FILE and filedata parameter the file’s location and type. The format for filedata values looks like @/path_on_my_server/video.mp4;type=video/mp4.curl "https://graph.facebook.com/<LATEST-API-VERSION>/<PAGE_ID>/messages" -H "Content-Type: application/json" -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>" -d '{ "recipient": { "id":"<IGSID>" }, "filedata":"<FILE_PATH>;type=<PATH_TYPE>" "message":{ "attachment": { "type":"<MEDIA_TYPE>", "is_reusable": "true", } } }'
{ "recipient_id": "<IGSID>", "message_id": "<MESSAGE_ID>", "attachment_id": "<ATTACHMENT_ID>" }