通过应用程序上传到 Facebook 后无法构建有效的图形 URL
我正在使用 Graph API 上传图像。图片已成功上传,我得到一个 ID 作为成功响应的一部分。然后,我获取返回的 id,例如 3368124406670,并尝试创建以下形式的 URL:
https:// graph.facebook.com/3368124406670
此 URL 将仅返回单词“false”。
我尝试过以下变体:
- https://graph.facebook.com/id=3368124406670
- < a href="https://graph.facebook.com/3368124406670?access_token=" rel="nofollow">https://graph.facebook.com/3368124406670?access_token={我的有效访问令牌}
- https://graph.facebook.com?id=3368124406670
我还无法找到将显示浏览器窗口中的图像。我做错了什么?
更新:
按照 Alexander 的指导,我将 user_photos 权限添加到权限列表中。现在构建图形 URL 并将其输入到浏览器中会得到以下结果,并且除链接之外的所有引用的 URL 均有效(不知道为什么 - 我收到“此内容当前不可用”):
{
"id": "3372724601672",
"from": {
"name": "Mahboud Zabetian",
"id": "1376000736"
},
"name": "Image captured with Lumin",
"picture": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_s.jpg",
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/s720x720/418881_3372724601672_1376000736_3381246_172283499_n.jpg",
"height": 479,
"width": 720,
"images": [
{
"width": 2048,
"height": 1365,
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/328625_3372724601672_1376000736_3381246_172283499_o.jpg"
},
{
"width": 720,
"height": 479,
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/s720x720/418881_3372724601672_1376000736_3381246_172283499_n.jpg"
},
{
"width": 180,
"height": 119,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_a.jpg"
},
{
"width": 130,
"height": 86,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_s.jpg"
},
{
"width": 75,
"height": 49,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_t.jpg"
}
],
"link": "https://www.facebook.com/photo.php?fbid=3372724601672&set=a.3242188098341.159612.1376000736&type=1",
"icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2012-02-20T22:07:38+0000",
"position": 56,
"updated_time": "2012-02-20T22:07:40+0000"
}
I am uploading an image using the Graph API. The image is successfully uploaded and I get an id as part of the success response. I then take the id that is returned, say 3368124406670, and try to to create a URL of the form:
https://graph.facebook.com/3368124406670
This URL will return just the word "false".
I have tried variants such as:
- https://graph.facebook.com/id=3368124406670
- https://graph.facebook.com/3368124406670?access_token={my valid access token}
- https://graph.facebook.com?id=3368124406670
I am yet unable to find a URL that will display the image in the browser window. What am I doing wrong?
UPDATE:
Following Alexander's guidance, I added user_photos permission to the permission list. Now constructing the graph URL and typing it into a browser gives me the following, and all URLs referenced work except for the link (not sure why - I get a "This content is currently unavailable"):
{
"id": "3372724601672",
"from": {
"name": "Mahboud Zabetian",
"id": "1376000736"
},
"name": "Image captured with Lumin",
"picture": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_s.jpg",
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/s720x720/418881_3372724601672_1376000736_3381246_172283499_n.jpg",
"height": 479,
"width": 720,
"images": [
{
"width": 2048,
"height": 1365,
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/328625_3372724601672_1376000736_3381246_172283499_o.jpg"
},
{
"width": 720,
"height": 479,
"source": "https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/s720x720/418881_3372724601672_1376000736_3381246_172283499_n.jpg"
},
{
"width": 180,
"height": 119,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_a.jpg"
},
{
"width": 130,
"height": 86,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_s.jpg"
},
{
"width": 75,
"height": 49,
"source": "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-snc7/418881_3372724601672_1376000736_3381246_172283499_t.jpg"
}
],
"link": "https://www.facebook.com/photo.php?fbid=3372724601672&set=a.3242188098341.159612.1376000736&type=1",
"icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
"created_time": "2012-02-20T22:07:38+0000",
"position": 56,
"updated_time": "2012-02-20T22:07:40+0000"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://graph.facebook.com/282737675106726?access_token=...
这应该有效。您是否获得了 user_photos 许可?
https://graph.facebook.com/282737675106726?access_token=...
This should be working. Are you getting user_photos permission?