B
B
bernaud2017-11-13 22:59:25
PHP
bernaud, 2017-11-13 22:59:25

api php facebook. How to post multiple photos with text to a group?

Help with the publication of several photos and text on Facebook.
In general, the code with the publication of one photo is as follows:

$photo1 = 'https://www.facebook.com/photo.php?fbid=айди1';
$photo2 = 'https://www.facebook.com/photo.php?fbid=айди2';

$response = $fb->post('/идгруппы/feed',array ('message' => 'test','link' => $photo1));

How to generate a code so that you can send more photos?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2017-11-13
@bernaud

More or less like this

$response = $facebook->api("/группа/feed", 'POST',
  array(
    'access_token=' => $access_token,
    'message' => 'Много фоток',
    'attached_media[0]' => '{"media_fbid":"айди первого фото"}',
    'attached_media[1]' => '{"media_fbid":"айди второго фото"}'
  )
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question