I built a curl script to post on fb pages a month ago; it was working fine as of today (30/04/2015) but the behaviour has changed. Earlier it was posting as the page on its feed but today it is posting as me, not as the page on its feed.
Has Facebook made any changes in its API that could have caused this?
NB:
I have extended my access token by using below code and have debugged it, as publish_action, publish_page, user_user_status access too
https://graph.facebook.com/oauth/access_token?client_id=XX& client_secret=XZ&grant_type=fb_exchange_token&fb_exchange_token=XXX
It's clearly stated in the docs at https://developers.facebook.com/docs/graph-api/reference/v2.3/page/feed/#pubperms that you need to use a Page Access Token if you want to post as Page:
A page access token with publish_pages permission can be used to publish new posts on behalf of that page. Posts will appear in the voice of the page.
Remember, today is the day that Graph API v1.0 gets deprecated!
Have a look at
https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens
on how to get a Page Access Token.
For me it was combination of both of the things. Now the facebook has fixed his bug, I have given manage_page rights to my app & my code starts working again.
Thank you all responding
For us our API suddenly stop working this morning and after almost 12 hrs of debugging we found that facebook has introduced a bug (which itself was a surprise to me)
Now waiting for fix to come
https://developers.facebook.com/bugs/380833342117530/
Related
I have been displaying facebook feed on my website using Facebook Graph API, I want to do the same to display Instagram feed. But in last month Instagram totally changed things for developers like it's not allowing creating clients here in there developer page - https://www.instagram.com/developer/clients/manage/ Now I totally messed up.
I tried Instagram Basic Display API following documentation here but I don't see a way to display other media fields like comments and likes counts per photo.
So is Instagram Graph API is the solution for this??
If yes then show me the right direction and it will save my time significantly. I also noticed in the doc of Instagram Basic Display API that access token expires in an hour which is not expected.
So is regarding access token, as mentioned in the documentation here, in step 3, is this the right way to generate token and when the token expires?, how to extend it?, I see lack of documentation on extending the token comparing with facebook Graph API's documentation.
To answer the questions:
Yes, that is the correct method to generate a token
According to Instagram, that one hour window for user account(s) is to be expected. There is currently no way to extend it. Even using the debugger method for extending the token life does not work. I've tried quite a few methods.
https://www.instagram.com/developer/authentication/
Instagram access token expiry time
https://developers.facebook.com/docs/instagram-basic-display-api/overview#instagram-user-access-tokens
Resource:
instafeed.js is a very simple tool once you have the access token.
Instafeed JS not loading
Additional info:
As of 2018, Instagram has been significantly curbing their calls to their API, and now, only Business & Creator accounts are allowed to use their basic-display-api. You can convert your personal profile to Creator or Business here: https://help.instagram.com/2358103564437429
https://developers.facebook.com/docs/instagram-basic-display-api.
The change I think you are talking about is the migration of basic permissions from the legacy instagram api to the new Graph API
https://www.developer-tech.com/news/2019/oct/15/instagram-launches-basic-display-api-deprecate-predecessor/
I hope this helps.
The final answer regarding the issue of short-lived tokens is here https://developers.facebook.com/docs/instagram-basic-display-api/guides/long-lived-access-tokens. Facebook had no plans to make extended tokens for Instagram. They closed a thread on their forums regarding this issue https://developers.facebook.com/support/bugs/3109002399171119/ but decided to make the extended tokens available for 60 days ONLY for Facebook. Now you can have a limited day non-expiring token for Instagram too.
I'm trying to get my own facebook page feed and register a wordpress post for every post on my facebook page. I got it working, but access token keeps expiring. I looked allover and still can't find a definitive answer about this.
Is it still possible to auto generate an access token using php? I have my facebook app id and secret. If so, how can I do this? Preferably without SDK.
You can use an Extended Page Token: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension
It is valid for at least 60 days though, and you cannot auto generate it. After that time, you may have to generate it again. Earlier, it was valid forever - until you changed your Facebook password or invalidate the App Secret.
We have a challenge in the office. We are developing a script that can post content from our database automatically on the wall. The problem is that we do not have access as soon as the user logs out.
Is there anyone here who has experience with this and possibly have solved it?
We is aware of https://developers.facebook.com/roadmap/offline-access-removal/ - Do you think facebook has ruled out the possibility completely?
As long as you are using Scenario 5 mentioned on that page you should be fine. https://developers.facebook.com/roadmap/offline-access-removal/
The page token shouldn't expire.
Check out the link on how to handle expired access tokens and extend tokens
http://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens/
https://developers.facebook.com/docs/facebook-login/access-tokens/#extending
I searched in Stack Overflow, Google, etc, but I can't figure out how to show my stuff from my Facebook on my website. I tried some solutions and each one prompted the login dialog and visitors had to log in and accept my application (I've created one to test).
Many answers here were too generic, I didn't understand them that is why I'm asking.
I want something that would let my website "log in" to Facebook and show my status or photos to visitors without them needing to accept an app or log in into Facebook with their account.
I tried a facebook-php-sdk example with my AppID and AppSecret and it asked me to log in.
Also, github.com/facebook doesn't have an SDK for Python similar to facebook-php-sdk
You could write a script (eg. using the FB PHP SDK) that uses a long-lived access token to fetch your FB data and then store the data in your backend database (or other store for your website). To Facebook, your script will look like an app and your machine will be the only 'user' of that app. Note, long-lived access tokens are good for 60 days max. You could also try using an App Access Token to fetch basic info. App Access Tokens don't expire.
This might not be exactly what you are looking for since you posted this with the php and python tag, but it might solve your problem.
If you're website is powered by the wordpress engine you can use If-this-then-that : https://ifttt.com/
It basically allows you to create "recipes" with something like:
if new status on Facebook then create post on wordpress
The post will not require others to log in to Facebook.
This is without writing a single line of code only a couple of mouse clicks. So I'm not sure if this satisfies your needs.
I have a Facebook application used as a tab in a fan page, that displays different information depending on whether tha user is a fan of that page or not.
Now I've been asked to have it post a message to a user's wall if they perform certain action (follow a link or whatever), and so far I haven't found a way to do that. All the documentation I have found refers to stand alone apps, and I've even seen it suggested (in the FB forums) that you can't get the auth token from an app.
So, i still think it can be done, but how?
If a user has authorized your app, you can post to her wall using the PHP SDK. See the PHP SDK api documentation for examples.
All apps have to be iframe apps now, so loading the JS sdk should be fine.
You have to get permissions first ->
http://developers.facebook.com/docs/authentication/#applogin
Then you can post using php with what Dhiren said, or, post with the fb.api function with JS ->
http://developers.facebook.com/docs/reference/javascript/FB.api/
Let me know if you need an example script.
Cheers