1
votes

I need to send private replies to page comments from my website. I am admin of the page and app.

Facebook's graph's api doc states following: "A Page access token with the read_page_mailboxes permission is required to create a message" but does not say, how to get the token with such permission.

I have tried tokens from "me/accounts", "/{page_id}?fields=access_token" and even generated 60 day access token from graph api explorer, but I get "OAuthException" with message "Requires read_page_mailboxes permission to manage the object". Any ideas?

2

2 Answers

2
votes

To get a permanent Page Access Token with the additional permission 'read_page_mailboxes' you have to:

  1. Generate a User Access Token with the permission 'read_page_mailboxes' for your app (use the Graph API Explorer) -> this generates a 24h User Access Token
  2. Extend this User Access Token to "expires never" (using the Access Token Debugger)
  3. Get a permanent Page Access Token with this User Access Token (using the Graph API Explorer on your Page Id)

See also: facebook: permanent Page Access Token?

Note: You don't need to request this permission through developers.facebook.com/apps - "App Review" - "Submission" - "Add Items"

-3
votes

You need to ask the user for that permission during login, of course – like with any other permission.

It is the user (page admin), that grants this permission. Only after that is done, the page access token will “include” that permission.