Facebook app: upload multiple images in one post to the wall

How to upload multiple images in one message via api?

Like here: http://www.facebook.com/SocialCity?v=wall

I was able to upload only one image through a curl request.

curl -F "access_token = token_here" -F "message = message_here" -F "picture = http://www.example.com/image.jpg" https://graph.facebook.com/app_id_here/feed

Or is it not possible to send multiple images this way?

Is anyone

Thank;)

+3
source share
3 answers

:

{user-id}/photos published=false

curl -i -X POST \
 -d "url=https%3A%2F%2Fwww.facebook.com%2Fimages%2Ffb_icon_325x325.png" \
 -d "caption=test%20photo%20upload" \
 -d "published=false" \
 -d "access_token=<user_photos_token>" \
 "https://graph.facebook.com/v2.6/me/photos"

You will receive an identifier for each photo you upload as follows:

{
  "id": "10153677042736789"
}

Publish a multi-page story using an endpoint {user-id}/feedand use the identifiers returned when uploading a photo

curl -i -X POST \
 -d "message=Testing%20multi-photo%20post!" \
 -d "attached_media%5B0%5D=%7B%22media_fbid%22%3A%221002088839996%22%7D" \
 -d "attached_media%5B1%5D=%7B%22media_fbid%22%3A%221002088840149%22%7D" \
 -d "access_token=<publish_actions_token>" \
 "https://graph.facebook.com/v2.6/me/feed"

Source: Publish a multi-file story.

0
source

Source: https://habr.com/ru/post/1778759/


All Articles