Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Now I posting a single photo to wall like this:

$response = $facebook->api("/$group_id/photos", "POST", array(
    'access_token=' => $access_token,
    'message' => 'This is a test message',
    'url' => 'http://d24w6bsrhbeh9d.cloudfront.net/photo/agydwb6_460s.jpg',
   )
);

It works fine, but can I somehow post a multiple photos, something like this:

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
537 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can now publish multiple images in a single post to your feed or page:

For each photo in the story, upload it unpublished using the {user-id}/photos endpoint with the argument published=false.

You'll get an ID for each photo you upload like this:

{
  "id": "10153677042736789"
}

Publish a multi-photo story using the {user-id}/feed endpoint and using the ids returned by uploading a photo

 $response = $facebook->api("/me/feed", 'POST',
  array(
    'access_token=' => $access_token,
    'message' => 'Testing multi-photo post!',
    'attached_media[0]' => '{"media_fbid":"1002088839996"}',
    'attached_media[1]' => '{"media_fbid":"1002088840149"}'
  )
);

Source: Publishing a multi-photo story


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...