I am currently posting images URLs on different facebook pages but I am using many calls to do the same thing.
Instead of this, I am trying to work on a batch request to save on execution time but I have an issue.
Doing many calls, I use this:
$urlLink = '/' . $pageId . '/photos';
$args = array(
'url' => $this->image_url,
'message' => $this->message,
'published' => false,
'scheduled_publish_time' => strtotime($this->programmed_dt),
);
$res = $this->fb->api($urlLink, 'POST', $args);
It works fine.
With the batch request I tried with that:
$urlLink = '/' . $facebookPage['id'] . '/photos';
$args['access_token'] = $facebookPage['access_token'];
$queries[] = array('method' => 'POST',
'relative_url' => $urlLink,
'body' => $args,
'url' => $this->image_url
);
$res = $this->fb->api('?batch=' . json_encode($queries), 'POST');
The response I have is:
{"error":{"message":"(#324) Requires upload file","type":"OAuthException","code":324}}
I tried to change the name field with all possibilities to send the image link, without success...
Any ideas for batch requests with image urls?