1

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?

Tauri28
  • 789
  • 1
  • 16
  • 29

2 Answers2

2

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"

electrobabe
  • 961
  • 9
  • 14
  • When I try to create a user token from Developer Tools, there is no `read_page_mailboxes` available in the list – igaster Jan 11 '19 at 15:21
-3

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.

CBroe
  • 82,033
  • 9
  • 81
  • 132