php - FB batch request : get Profil Images of managed Pages -
hi there tried profile-images of pages managed. tried this:
// loop:
$request[] = array( 'method' => 'post', 'relative_url' => '/'.$account->id.'/?fields=picture.type(large)&access_token='.$account->access_token.'' );
and then:
$batchresponse = $this->facebook->api('?batch='.json_encode($request),'post',array('access_token' => $this->facebook->getaccesstoken()));
without success :/
i tried set access_token of page in body tag:
$request[] = array( 'method' => 'post', 'relative_url' => '/'.$account->id.'/?fields=picture.type(large)' 'body' => '&access_token='.$account->access_token.'' ;
your php script should have login. if login successful, sdk manage access_token you.
then issue 1 request:
$result = $this->facebook->api('/me/accounts?fields=name,picture.type(large)', 'get');
if don't want authenticate, instead can pass array of ids:
$page_ids = array( _page_id_1, _page_id_2, ...); $result = $this->facebook->api('/?ids=' . implode(',',$page_ids) . '&fields=name,picture.type(large)', 'get');
for these queries, getting data, should using get
request. within facebook api, post
requests used when sending data facebook.
Comments
Post a Comment