Sunday, January 9, 2022

[FIXED] PHP Facebook SDK API get multiple feeds in one request

Issue

I am watching 2 pages for used car parts. I want to call both page feeds in a single call sorted by last post. I am trying this code but it doesn't work...

/* PHP SDK v4.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $sess,
  'GET',
  //'/89641180016/feed' //single call works!
   '/89641180016/feed','/93811111500/feed' //multiple call fails
);
$response = $request->execute();
$graphObject = $response->getGraphObject()->AsArray();
/* handle the result */

Solution

You can use /feed?ids=89641180016,93811111500 (see doc: Making Multiple Requests)



Answered By - Yassine Guedidi

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.