$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());
我被困在这里。在网页中,第一个 fburl 组遍历了 25 个帖子,但我无法调用每个帖子的附件来运行。错误是:
Fatal error: Uncaught exception 'FacebookFacebookAuthorizationException' with message '(#803)
Some of the aliases you requested do not exist: aaaaa...aaaaa_aaaaaaaaa..aaa?fields=attachments'
in C:wwwroot....php-sdk4FacebookRequestException.php:134 Stack trace: #0
C:wwwroot.,..php-sdk4FacebookRequest.php(268):
FacebookFacebookRequestException::create('{"error":{"mess...', Object(stdClass), 404) #1 C:wwwroot.....php(386): FacebookFacebookRequest->execute() #2 {main} thrown in C:wwwroot....php-sdk4FacebookRequestException.php on line 134
错误消息中回显的"FBatturl"在图形资源管理器 (2.1( 中工作。
按照这个例子 Facebook PHP SDK4 - FQL 请求 我已经尝试过...
$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());
并收到相同的错误,我假设附件已失效。他们变得非常成问题。
从这里到哪里去?应该可以从帖子链接中获取照片吗?我是否读到新 SDK 中会有带有帖子的照片?
"附件"(与故事或评论相关的媒体内容(现在是帖子的边缘......
https://developers.facebook.com/docs/graph-api/reference/v2.2/post/
https://developers.facebook.com/docs/graph-api/reference/v2.2/story_attachment