I've tried to send attachments like photo, voice and video in Instagram but I succeeded in voice & video not in uploading photo.
I tried uploading photo to Facebook server and I succeeded in, here's the cURL:
curl --location 'https://graph.facebook.com/v20.0/37*********4808/message_attachments?access_token=EAAON9rR********************CyKHzV' \
--form 'filedata=@"./whatsapp-cloud-api.png"' \
--form 'message="{\"attachment\":{\"type\":\"image\",\"payload\":{}}}"'
As per request I get the following response:
{
"attachment_id": "53*********4940"
}
But When I tried to send message to Instagram by the attachment_id I get, using the following cURL:
curl --location 'https://graph.facebook.com/v20.0/37*********04808/messages?access_token=EAAON9rRp97********************24CyKHzV' \
--header 'Content-Type: application/json' \
--data '{
"recipient": {
"id": "159**********901"
},
"message": {
"attachment": {
"type": "image",
"payload": {
"attachment_id": "53**********4940"
}
}
}
}'
As per this request I get the following response:
{
"error": {
"message": "Unsupported request - method type: post",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "APMZQqMefSnkK2P30rBfUTC"
}
}
Unsupported request - method type: post
. Please, help me here. Thanks in advance.My business is approved even permissions are also reviewed and approved by meta, but still not working?