How do I grab the contents of a Facebook Note using the Graph API?

落花浮王杯 提交于 2019-12-13 07:41:12

问题


I'm trying to access the notes of a page using a long-lived access token I've generated. I tried accessing the following two end-points:

https://graph.facebook.com/<note_id>?access_token=<token>
https://graph.facebook.com/v1.0/<note_id>?access_token=<token>

but both returns the following error message:

{
   "error": {
      "message": "(#12) notes API is deprecated for versions v2.0 and higher",
      "type": "OAuthException",
      "code": 12
   }
}

I tried getting the notes using the access token I generated from the Graph API Explorer, and it works perfectly; but it's a short-lived token that lasts only 60 minutes. As the error says, the notes API is deprecated for versions 2.0 and higher; does this mean I can no longer access the notes using the graph API?

My question is just: how do I get the note content given a note ID, and a long-lived access token in PHP? (without using any SDKs if possible)

Note: I'm not looking for code to copy-paste. I've been trying for hours to get this to work but to no avail. Just trying to figure out "how". Any help would be greatly appreciated!


回答1:


https://developers.facebook.com/docs/apps/changelog

/me/notes is no longer available, along with the user_notes permission.

Unfortunately, the API for notes got removed completely and can only be used until end of April 2015, and only with an App created before end of April 2014.

This is also visible in the reference: https://developers.facebook.com/docs/graph-api/reference/v2.1/note

This document refers to a feature that was removed after Graph API v1.0.

It only works in the API Explorer if you select the API Explorer App, because that App can still use v1.0.



来源:https://stackoverflow.com/questions/26386514/how-do-i-grab-the-contents-of-a-facebook-note-using-the-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!