Facebook Access Token - Comment as Site - facebook

I have a big Problem, i search since days a Solution for my Problem. Maybe here someone can help me.
I need a Access Token for my Fanpage. I know i need manage_page rule.
I also have create a App. With ID and Secret ID.
My Problem is when i use the Token it post as Admin not as Site. And the post on the Fanpage must be as Site.
I Hope someone can help me.

If it posts as user/admin and not as Page, you are most likely using a User Access Token. If you want to post as Page, you need to use a Page Access Token with the publish_actions permission: https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed#publish
Some Links about creating Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Related

How to get facebook page reviews Even i have accessToken

I want to get only facebook page reviews. I have accessToken and I am able to access the feed/post. What permission should I set to get page reviews and what should be complete url to get fb page reviews, which I can use in an API call ?
Please respond it. Thanks in advance.
https://developers.facebook.com/docs/graph-api/reference/page/ratings/
The only thing you need is a Page Token.
How to get a Page Token is explained here:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

facebook permernant access token user_posts?

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.

Facebook Page Access Token can be used to post stuff?

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!

Obtaining Facebook Page token via Facebook Graph Explorer?

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}

Facebook long-lived accesstoken for a page

I'm using a facebook extension in TYPO3 to pull out the facebook posts of a page. Therefor I need the accesstoken.
I googled around and found that I need a facebook app and I need to be administrator of the page.
Then I heard that I need to connet the app with the site, but how can I do this?
I also tried to get accesstoken:
https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials
And then performing:
https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token& client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token}
... with this token but it says No user access token specified
Can someone help me step by step how to get the long lived token?
As you just want to pull, you really don't need a page access token. Until and unless you have a demographic or other restriction over your page. All the pages are Public and data over them can be easily accessed by using the App Access Token which is simply put
Your_App_ID|Your_App_Secret
first u need to get an API key from facebook, so here are the steps--->
http://www.shoutmeloud.com/how-to-acquire-your-facebook-api-key.html
& then u can access facebook API, these are docs provided by the facebook to use that API--->
https://developers.facebook.com/docs/guides/web/
This was my implementation (PHP):
$newposts = json_decode(file_get_contents("https://graph.facebook.com/YOURFBPAGE/feed&access_token=YOURAPPID|YOURAPPSECRET"));
Since I was only using this to make simple pull request of my feed posts this is the best way to do it. You don't have to deal with expiring access tokens. Just create your facebook App and get the ID and secret.