通过应用程序上传到 Facebook 后无法构建有效的图形 URL

发布于 2025-01-07 05:46:40 字数 2646 浏览 1 评论 0原文

我正在使用 Graph API 上传图像。图片已成功上传,我得到一个 ID 作为成功响应的一部分。然后,我获取返回的 id,例如 3368124406670,并尝试创建以下形式的 URL:

https:// graph.facebook.com/3368124406670

此 URL 将仅返回单词“false”。

我尝试过以下变体:

我还无法找到将显示浏览器窗口中的图像。我做错了什么?

更新:

按照 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:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清眉祭 2025-01-14 05:46:41

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文