Issue
I am trying to get my page reviews and insert them in the database. The problem is that i need to get this into a cron job. So to access /{page-id}/ratings i need to follow this steps:
- Need to log in with Facebook in order to get the user session
- After that, if the user is the admin of the page i can access /me/accounts and get the page token
- After i take the page token i can get the reviews/ratings by accessing /{page-id}/ratings
I must do all of this automatically. How can i get the user session to use it every time without logging in again.
Solution
You need to use an Extended Page Token that is valid forever.
If you don´t know how to generated Extended Tokens, here are some articles:
- https://developers.facebook.com/docs/facebook-login/access-tokens/
- http://www.devils-heaven.com/facebook-access-tokens/
- http://www.devils-heaven.com/extended-page-access-tokens-curl/
Basically, you just need to generate an Extended User Token and call /me/accounts
with that one to get an Extended Page Token.
Answered By - andyrandy
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.