How do I grab the contents of a Facebook Note usin

2019-09-17 20:40发布

问题:

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.