Facebook - post on wall by cron - facebook

Can i post on wall by CRON when my account haven't permissions to my app?
This is my APP, i can manage her in https://developers.facebook.com/app and i'm admin of this APP. I want post from admin account, no from other users.
I use long-live access token but, when my account haven't permission to app API show error and API need this permissions.
Maybe offline_access? What about setAccessToken?
I user facebook PHP API.

offline_access have been deprecated since SDK 3, so you should get a long-lived access token. Get long live access token from Facebook

Related

Facebook long lived Page Access Token

I am administrator of facebook page which DOES NOT have a classic facebook account assigned. So I am not able to create any facebook application as you can see in Picture 1. How can I obtain long lived (never expiring) page access token, which I need to use Graph API? I need to post messages to the facebook page from my server.
Thanks for advice
You do need a User account that is admin of the Facebook Page in order to get a Page Token. Without a User account, it is not possible.
HereĀ“s what you need to do:
Authorize the User account in the App - which means, get a User Access Token
Extend the User Token
Get an Extended Page Token with /me/accounts or /[page-id]?fields=access_token
Some Links for more information:
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/

Foursquare API - Access foursquare token, when "connected app" uses facebook to login

We are building a foursquare connected app, using Facebook for login. In this scenario, is there a way for our servers to see foursquare access token specific to our app, so that we can associate that token with the user account validated against facebook?
It is not possible to get a list of all access tokens for your app. When a user authorizes your app with Foursquare, you should store their OAuth access token so you can make requests on their behalf. You will follow a similar process to authenticate with Facebook. Your app will need to maintain the association between their Foursquare token and their Facebook token.
If you have lost the Foursquare access token, you can send the user to foursquare.com/oauth2/authenticate, as on this page (https://developer.foursquare.com/overview/auth), and your app will receive another OAuth token for the user, as you did when they originally authorized the app.

Can obtain facebook user basic information with ONLY access token?

I'm doing an IOS app with facebook SSO. Upon user granted facebook permission to the app, the app will receive an access token. The app will then make an API call to the backend with ONLY the access token.
So is the backend possible to retrieve basic user information with ONLY access token while the user's facebook id is unknown?
Looking forward to an answer. thank u=)
Yes, once you have a user access token /me can be used as a placeholder for the current user's user ID
so /me/friends returns the access token user's friends, etc
It's a bug that has been recorded and fixed by Facebook. Update your base_facebook.php to versions 3.2.2.
You can track the bug here: https://developers.facebook.com/bugs/238039849657148

Post on facebook wall from Java WebService

I am looking for a way to publish stuff on my facebook wall from a java-webservice.
I was looking around and found that there WAS offline_access that is now deprecated.
So...
How can it be done?
You have two options I can think of:
Get a long lived user access token (using server-side authentication, or client-side and then extending the token) when the user interacts with you app, then you have a valid token for 60 days.
When the 60 days are over you'll need the user to re-engage your app to get a new token.
You can ask for the publish_stream permission and then using an app token you can post on the users' behalf:
App access tokens can also be used to publish content to Facebook on
behalf of a user who has granted a publishing permission to your
application.
App Access Tokens generally do not expire. Once generated, they are
valid indefinitely.

How to get permanent access token in graph API

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.