0
$fburl = "/XXXXXXXXXX/posts?fields=$fields&limit=25$nav";
echo "FBURL: $fburl<br />";
$request = new FacebookRequest( $session, 'GET', "$fburl");
$response = $request->execute();
$FBdata = json_decode($response->getRawResponse());

$fbatturl = urlencode("/$postid?fields=attachments");
echo "FBATTURL: $fbatturl<br />";
$request = new FacebookRequest( $session, 'GET', "$fbatturl");
$response = $request->execute();
$FBattdata = json_decode($response->getRawResponse());

I'm stuck here. In a web page The first fburl group iterates through the 25 posts but I can't get the call to each posts' attachments to run. The error is:

Fatal error: Uncaught exception 'Facebook\FacebookAuthorizationException' with message '(#803) 
Some of the aliases you requested do not exist: aaaaa...aaaaa_aaaaaaaaa..aaa?fields=attachments'
 in C:\wwwroot\....php-sdk4\FacebookRequestException.php:134 Stack trace: #0 
  C:\wwwroot\.,..php-sdk4\FacebookRequest.php(268): 
  Facebook\FacebookRequestException::create('{"error":{"mess...', Object(stdClass), 404) #1 C:\wwwroot\.....php(386): Facebook\FacebookRequest->execute() #2 {main} thrown in C:\wwwroot\....\php-sdk4\FacebookRequestException.php on line 134

The 'FBatturl' echoed in the error messages work in the Graph Explorer (2.1).

Following this example Facebook PHP SDK4 - FQL Request I've tried ...

$params = urlencode("SELECT attachment FROM stream WHERE source_id=$StatusID[0] AND      post_id=\"$postid\"");
$request = new FacebookRequest( $session, 'GET', $params );
$response = $request->execute();
$FBattdata = json_decode($response->getRawResponse());

and received the same error and I'm assuming the attachments are defunct. They were getting very problematic.

Where from here? It should be possible to get the photos from the post link? Did I read there would be photos with posts in the new SDK?

4

1 回答 1

0

“附件”(与故事或评论相关的媒体内容)现在是帖子的边缘......

https://developers.facebook.com/docs/graph-api/reference/v2.2/post/

https://developers.facebook.com/docs/graph-api/reference/v2.2/story_attachment

于 2014-11-24T14:36:31.717 回答