Schedule on facebook page

I am trying to schedule a photo on a facebook page as a page. When I try to schedule only the message, then it works, but when I give the image source, then it gives an error. The graph returns an error: an unexpected error has occurred. Please try again later.

$image = url().'/images/logo.png';

$data = [
'message' => 'new schedule 1',

'source' => $image,

'published' => 0,

'scheduled_publish_time' => $epochTime

];


$response = $fb->post('/949206005163395/feed', $data, $pageAccessToken);

Please, help

+4
source share
1 answer

Finally found the answer after research for two days. Hope this helps another. ** Decision: **

date_default_timezone_set('America/New_York');
        $epochTime = strtotime("now +15 minute");
        $data = [
            'message' => 'Your message',
            'no_story' => 0,
            'link'=>'http://www.planwallpaper.com/static/images/Winter-Tiger-Wild-Cat-Images.jpg',
            'picture'=>'http://www.planwallpaper.com/static/images/Winter-Tiger-Wild-Cat-Images.jpg',
            'published' => 0,
            'scheduled_publish_time' => $epochTime
        ];
$response = $fb->post('/'.$post->page_id.'/feed', $data, $pageAccessToken);

You can also specify a link using the link attribute.

+3
source

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


All Articles