不支持的获取请求

编程入门 行业动态 更新时间:2024-10-14 10:39:37
本文介绍了不支持的获取请求-Facebook API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试通过Facebook API获取Facebook Pages的提要.

I am trying to get a Facebook Pages' feed through the Facebook API.

将我的页面之一-koodoocreative放入我的代码中,根本没有问题.

Putting one of my pages - koodoocreative into my code brings back the data no problem at all.

但是当我尝试将其中一个客户端加载到API中时,我收到消息...

But when I've tried loading in one of our clients into the API, I get the message...

不支持的获取请求

Unsupported get request

随附的是页面权限的图像

Attached is an image of the pages' permissions

我的PHP代码如下....

My PHP code is as follows....

// init app with app id (APPID) and secret (SECRET) FacebookSession::setDefaultApplication('',''); $session = new FacebookSession(''); // First Get The Groups' Details... $request = new FacebookRequest( $session, 'GET', '/'.$app_view->app_view_title ); $response = $request->execute(); $graphObject = $response->getGraphObject(); $page_name = $graphObject->getProperty('name'); // Next Get The Posts... $request = new FacebookRequest( $session, 'GET', '/'.$app_view->app_view_title.'/feed?limit=10' ); $response = $request->execute(); $object = $response->getGraphObject(); $fbdata = $object->getPropertyAsArray('data'); ?>

推荐答案

问题是您在页面上使用用户名,例如/koodoocreative,而客户可能未必拥有此功能.您应该改用数字页面ID,这样,API调用将适用于带有和不带有虚名URL的页面.

The issue is that you're using username for the pages, e.g. /koodoocreative, whereas the client may not necessarily have this. You should use numerical Page IDs instead, this way, the API call will work for pages with and without vanity URLs.

更多推荐

不支持的获取请求

本文发布于:2023-11-12 10:56:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!