I looked all over facebook api docs for FLEX and i couldn't find a way to obtain a new access token, can anyone please guide me how to that?
By the way , the only time I get error "access token" is when I try to get information from the api and using the parameter "since".
when I use this call, im getting a token error message
FacebookDesktop.api("me/likes?since=1319917311",handleFeed);
and when im using it without since
FacebookDesktop.api("me/likes",handleFeed);
I get no error message
anyway the main issue is how to obtain a new access token
10x!
You should use third argument of FacebookDesktop.api method to pass additional parameters:
FacebookDesktop.api("me/likes",handleFeed, {
since:1319917311
});
Related
I try to get Refresh token with Postman using the following data:
and get a response:
What is wrong I do?
You need to provide the scope as https://storage.azure.com/user_impersonation instead of https://storage.azure.com/.default.
I tested the same in my environment and faced the same issue as well as you can see below:
As a Solution , I changed the scope as I have mentioned and I was successfully able to get the token and test the same for your requirement as well.
Note:
Please make sure to add callback_url that postman uses (i.e. https://oauth.pstmn.io/v1/callback) in the reply url of the Azure AD app as shown below:
Using push API continuously returns token count should within 1 and 1,000. Please find the API error in the screenshot.
The possible causes of this problem is, you have placed the “token” attribute in wrong place.
Solution:
Please keep your “token” attribute within the “message” object,.
enter image description here
For details, check the following documents:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110
Your token is outside the message body, "token", "android" should be within the message body.
Please check the sample code here
Also, if you want to use more tokens (>1000), the best method is to invoke the API using App server and send messages in batches.
I'm creating a custom module in Drupal, that for part of its functionality must fetch posts from a business page. So for simplicity, I'm using fbapp module as a dependency (drupal.org/project/fbapp), so that I can use it's authentication and request functions (fbapp_app_authenticate() and fbapp_graph_request()) without having to worry about the constant facebook graph updates making my own code obsolete.
I've created a facebook app, so authentication should be app token, using appid and app secret. This seems fine and I'm getting back access_token. However, when I try to read posts from a publicly available page (the clients), I get the response:
"Unsupported get request. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api"
Here's the queries and responses my code produces:
graph.facebook.com/oauth/access_token?client_id=<redacted>&client_secret=<redacted>&grant_type=client_credentials
array(1) {
["access_token"]=>
string(43) "<redacted>|<redacted>"
}
graph.facebook.com/<page_id>/posts?access_token=<redacted>|<redacted>"
string(183) "{"error":{"message":"Unsupported get request. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100}}"
Can anyone verify a correct way to query a Facebook page programmatically, perhaps there's a setting in the page I'm querying that I need to set (although I can't find anything)?
If page restrictions apply, the page's feed can only be retrieved with an user access token as far as I know (because FB needs to evaluate the visibility criteria, and setting your app to the same restrictions doesn't help here):
See
https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed#readperms
It looks like everything you have done is correct. The response you got can be (i am not sure) because you got your clients pageid wrong.
I have been trying to subscribe to real-time updates for the past week and I have been unsuccessful.
When I do the HTTP post (using rest-client) to URL:
https://graph.facebook.com/<app-id>/subscriptions
...I get this error message as response:
{"error":{"message":"(#100) The parameter object is required","type":"OAuthException"}}
My header parameters were as follows:
access_token=***,
object=user,
fields=friends,
callback_url=https://aaa.appspot.com,
verify_token=(app secret key)
I'm not able to find where I'm going wrong.
Somebody please kindly guide/help me figure my mistake.
The below link was used as a reference.
http://www.fb-developers.info/tech/fb_dev/tutorial/bytopic/realtime_upd_02.php
Thanks you for your time in advance.
You need to send your request to https://graph.facebook.com/appid/subscriptions and not https://graph.facebook.com/subscriptions - although that might be an error in your question and not your code!
EDIT: I just checked the markup for your question and you do have appid in the URL, it just wasn't displaying properly
How are you getting the access token? You must use an application access token and not a user access token, i.e. retrieve the access token from https://graph.facebook.com/oauth/access_token?client_id=<APP_ID>&client_secret=<APP_SECRET>&grant_type=client_credentials
https://developers.facebook.com/docs/reference/api/realtime/ is the official documentation, that might be more up to date than the link you've been using.
So I have a page, and am trying to create an app that determines whether or not a user is an admin of that page. The documentation states to use page_id/admins/user_id, which I am. However, it keeps throwing the error "Subject is not a page," which is obviously is, and even when I get just the page, it's type is set to "page." Why am I getting this error, and how would I fix it?
You should use the Page access token when making this call - see https://developers.facebook.com/docs/reference/api/page/#page_access_tokens
The "subject" in this case is the page so you should use that access token.