I am trying to subscribe my facebook chatbot to the user's page, using the manage_pages permission.
I already have the permission approved to my app, but I am having trouble, because the token is generated in the browser(in Brazil), but I send it to aws lambda in US west 2, and I get the following error
The \'manage_pages\' permission must be granted before impersonating a user\'s page.
In my test, I run the subscribe process in my machine, and reuse this token in AWS Lambda(US West 2). After researching and making some tests, I figured out that it just dont work in USA, in Brazil it works. Using the same token generated in the process, I run the following test.
var request = require("request")
request.post("https://graph.facebook.com/v2.9/me/messages", {
qs: {
access_token: "GENERATED TOKEN"
},
json: {
"recipient": {
"id": "USER_ID"
},
"message": {
"text": "hello!"
}
}
},function(e){
if(e){
return console.log("ERROR",e)
}
console.log("FINISH",arguments)
})
When I run with my internet, it works fine, but If I use a VPN in Miami, the error occurs.
I believe it has something to do with the data replication that facebook does, but how can I make this token be accessible by the USA region?
EDIT
I found this error when starting the facebook login process with the VPN online:
I didnt find any restrictions in my app, where can I check this?