Reputation: 51
From our app we want users to be able to authenticate with Facebook and to be able chat from within our app with their Facebook Page visitors (webhook / Send API).
We are able to get the page access token, but are having trouble subscribing our Facebook app to the page using the page access token.
The steps are as follows:
User initiates authentication
Exchange code for user access token
/v2.7/oauth/access_token?client_id=[client_id]&redirect_uri=[redirect_uri]&client_secret=[client_secret]&code=[code]
Get Pages (and page access tokens) using user token
/v2.7/me/accounts?access_token=[user_access_token]
Subscribe our app to the Facebook Page using obtained page access token
/v2.7/me/subscribed_apps?access_token=[page_access_token]
This is where we are having trouble. The response from step 4 is:
(#230) permission pages_messaging is required to register webhook for messages or deliveries
All API calls are using v2.7 and the manage_pages, publish_pages and pages_messaging permissions have all been approved for the app.
Any ideas or help on what we are missing?
Upvotes: 1
Views: 623
Reputation: 96306
pages_messaging
is only available since API v2.7
You are making an unversioned call to the login dialog, so it will fall back to the lowest API version your app can use. If that’s not 2.7, your attempt at asking for pages_messaging
will be ignored.
Specify the API version in your login dialog call:
https://www.facebook.com/v2.7/dialog/oauth?…
^^^^
Upvotes: 1