As per facebook API documentation we can get Facebook Page ratings using "/{page_id}/ratings". For this we need page access token.
https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings
How can I get Page Access Token from facebook application.
Please help me.
Thanks,
You can use the
/me/accounts
endpoint as described here:https://developers.facebook.com/docs/graph-api/reference/v2.0/user/accounts/
Be sure to grant the manage_pages permission. Try it
https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Faccounts&version=v2.0
Furthermore, I'd recommend to exchange the short-lived token from the last step to a long-lived one (60 days) as described here: https://developers.facebook.com/docs/facebook-login/access-tokens/#extending
Related
Our web development firm is requesting a page access token. Currently, the only page access token we can generate provides full admin access and we do not want to share any advertising spend, post insights or analytics information with the web development firm. The objective of the API key / page access token is to pull content from our Facebook business page and display it on our new site, only.
Is it possible to create a page access token / API key with limited permissions? and what are the steps required? I was unable to find any specific documentation on the topic.
Thanks in advance.
Each Token can include different permissions. The most basic Page Token only includes the manage_pages permission, in addition you can add publish_pages which allows to post to a Page with the Token, or read_insights to get access to Page insights. A list of possible permissions can be found in the docs: https://developers.facebook.com/docs/facebook-login/permissions/
In your case, a Page Token with only the manage_pages permission will be good enough.
I have no idea about how facebook tokens or APIs work, so please excuse my ignorance.
I am trying to get a access token to display my posts to my wall. My website is www.quadscene.co.nz and on the homepage I am trying to display all posts to wall.
I have created a access token using some tools within facebook, but they expire within about 2 hours, these token work fine when selecting the user_posts option or permission, however all other access tokens ive tried do not display posts.
I think its using OAuth.
Is there a way to create a token that will not expire? and has the user_posts permissions?
Thanks in advance!
You need to read the docs to understand how OAuth works and what different access tokens are available.
Specifically, you need to look at the long-lived tokens.
I have read some introduction about Facebook's access token on http://www.devils-heaven.com/facebook-access-tokens/
What I want to ask is that can the page access token of Facebook be used as a permanent token if I just want to post something on the wall like user access token?
First of all don't ever follow the third-party documentation for the facebook integration. They have the official documentation pls follow that. For access tokens read here.
What I want to ask is that can the page access token of Facebook be used as a permanent token if I just want to post something on the wall like user access token?
Its actually a vague question. It depends on what kind of posting you want to do. For eg:
If you want to post on a user's wall- there's nothing that a page access token can do
If you want to post a user's group/event etc. wall, again page access token has nothing to do with it.
If you want to post on a page, then yes you have to use the page access token in order to post on behalf of page itself.
Page access tokens are used in Graph API calls to manage Facebook Pages. To generate a page access token, an admin of the page must grant an extended permission called manage_pages. Once this permission has been granted, you can retrieve the page access token using the following Graph API request:
GET /{user-id}/accounts
You can also extend a page access token that will never expire. See here how to do that!
I am trying to follow the steps on this page but using the Graph Explorer instead: http://aseriesoftubes.com/articles/obtaining-facebook-page-access-tokens-the-4-step-program/
Can someone help with steps in getting a permenant Page Token from the Graph Explorer? Some posts are outdated and referring to offline access. Thanks for any help or advice.
This article is correct, i just tested it: http://www.devils-heaven.com/facebook-access-tokens/
See "Extended Page Access Token" in the article: Basically you have to authorize yourself with the "manage_pages" permission, then you need to extend your User Access Token, and with that Token you make a call to /me/accounts to get the Extended Page Access Tokens for all your pages.
STEPS FOR LASTING PAGE ACCESS TOKEN
1- You have to get page access token for a user by this API:
https://graph.facebook.com/{User-id}/accounts?access_token={access-token}
2- Then u have to refresh the save token by below API which will last for 60 days:
https://graph.facebook.com/oauth/access_token?client_id={your-client-id}&client_secret={client-secret}&grant_type=fb_exchange_token&fb_exchange_token={previous-access-token}
I created an APP on Facebook and using graph API explorer, I selected my app from app drop down box, requested access token with manage_pages, offline_access and publish_stream permissions.
Using this access token, I was successfully able to post message on page using restfb APIs but when I log out, it starts throwing The session is invalid error.
I read on few posts that offline_access is deprecated. Could someone tell me how to obtain permanent access token?
Thanks
Looking at the docs at: https://developers.facebook.com/roadmap/offline-access-removal/ this is no longer possible.
Desktop applications will not be able to extend the life of an
existing access_token and the user must login to facebook once the
token has expired.
Otherwise, it is possible to request an access token with a longer expiration. Here are the directions: https://developers.facebook.com/roadmap/offline-access-removal/#extend_token
What kind of Access Token do you need? There are three kinds, User AT, App AT and Page AT.
If you want User AT, it seems you are out of luck. I don't think it's possible anymore. You can only get to 60 days. However, if you need Page AT, you can get a permanent one. The difference is, Page Access Token only has access to a single facebook page.
Basically you need to get User Access Token first, with manage_pages permission. When you have one, you have to look at /{pageId}?fields=access_token for your page's id in Graph API.
For more info look at: facebook: permanent Page Access Token?
you will not get any permanent access token as Facebook developer blog explains. you will be given 60 days long lived access token. Before the expiration Facebook will notify you about the expiry and then you can renew it or you can build your own custom control to get the notification on token expiration which you can fetch from Facebook API.