Upload multiple attachments using Messenger Send API

654 Views Asked by At

I want to use Facebook Messenger API to send multiple images in a single message. I have those files as Temp files on rails app server. I found this Attaching a file, which provides the following way of sending a file as attachment

curl  \
  -F 'recipient={"id":"<PSID>"}' \
  -F 'message={"attachment":{"type":"<ASSET_TYPE>", "payload":{"is_reusable":true}}}' \
  -F 'filedata=@/tmp/shirt.png;type=image/png' \
  "https://graph.facebook.com/v8.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>"  

but it specifies only one file to be uploaded, hence I cannot use it.
Moreover, there's this Deprecated List Template but I cannot use this since it is deprecated. Is there a way to send multiple file attachments in one message using messenger platform's API?

0

There are 0 best solutions below