Graph API delete all scores - facebook

As stated in the Scores API documentation:
You can delete all the scores for your app by issuing an HTTP DELETE request to /APP_ID/scores with the app access_token for that app. This will reset the scores for your app. Use this if you'd like to periodically reset your game's scores and leaderboards.
So I go to Graph API Explorer and type /(APP ID OMITTED)/scores, Select DELETE method and paste in the app token I get from Access Token Tool in the access token field. I click submit and the following error is displayed:
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
If I paste in the user's token ID instead I get this:
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15
}
What am I doing wrong?

Related

Search users from Facebook Graph API

I'm trying to search for users on facebook with an app token. Here's the endpoint that I'm accessing with the graph explorer (I've tried both app and access tokens):
https://graph.facebook.com/v2.5/search?q=foo
Here's the error that I'm receiving:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "BbsgVF64X28"
}
}
Any idea what I'm doing wrong?
Look at the docs at
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#search
You need to specify a type parameter to be able to use the search, like
https://graph.facebook.com/v2.5/search?q=foo&type=user

Facebook Graph Explorer Error Code 100 (OAuthException)

So I am inputting my correct access token and the correct ID, and when I use GET, it returns this error.
{
"error": {
"message": "(#100) Requires user session",
"type": "OAuthException",
"code": 100
}
}
When I use Get Access Token to get a test token, it returns the correct information. Why is this happening?

How can I fetch age-restricted page using generic app token?

How can I fetch age-restricted page using generic app token ?
Here is how I get app token
https://graph.facebook.com/oauth/access_token?client_id=1237603453455381&client_secret=3539257a5231e337bb26d110bfb5e500&grant_type=client_credentials
But when I attempt to call
https://graph.facebook.com/60409543921?access_token=1237603453455381|H4PkFBu2PlSzHHMLPvHcSt8Y9Os
I get error
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Is there workaround against it other than using my personal token on server ?

Facebook: How to set app test users as friends?

1) I try to get an access token for my app as described in the docs:
To obtain an App Access Token, invoke the following HTTP GET request
GET https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&client_secret=YOUR_APP_SECRET
&grant_type=client_credentials
The API will respond with a query-string formatted string of the form:
access_token=YOUR_APP_ACCESS_TOKEN
I get an access token with a strange splitter sign | as a result:
access_token=568852943149232|ah1X8cAXHKSvFrTrZ4XybG0GzR4
This seems to be in a conflict with the docs, because the first parameter is app_id (before the sign |).
2) Then I try to use the strange access_token to get friend's access tokens (it requires to make invisible test users friends):
https://graph.facebook.com/APP_ID/accounts/test-users?access_token=568852943149232|ah1X8cAXHKSvFrTrZ4XybG0GzR4
It returns:
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: APP_ID",
"type": "OAuthException",
"code": 803
}
}
If I remove the part before | (including the sign |) and make another request it returns another error:
{
"error": {
"message": "Invalid OAuth access token.",
"type": "OAuthException",
"code": 190
}
}
3) In result I need to make a 'friend' request from one user and response from another (described here):
https://graph.facebook.com/USER1_ID/friends/USER2_ID?method=post&access_token=TEST_USER_1_ACCESS_TOKEN
https://graph.facebook.com/USER2_ID/friends/USER1_ID?method=post&access_token=TEST_USER_2_ACCESS_TOKEN
I can't do that because I can't get these (users') access tokens on the step 2.
Is returning app access_token correct? If yes, how to use it?
Notice please: I make the calls from an address line of a browser, app owner in a logged-in state.
You need to replace APP_ID with your actual APP_ID
That's why you get this message.
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: APP_ID",
"type": "OAuthException",
"code": 803
}
}
If your app id is 568852943149232 and your app token is 568852943149232|ah1X8cAXHKSvFrTrZ4XybG0GzR4 then your call is
https://graph.facebook.com/568852943149232/accounts/test-users?access_token=568852943149232|ah1X8cAXHKSvFrTrZ4XybG0GzR4
That is indeed your app token easily verifiable by https://developers.facebook.com/tools/access_token

Search for places with an App Access Token suddenly stopped working

i am calling the graph API with an App Access token (grant_type=client_credentials) to search for places on facebook. Quering for
https://graph.facebook.com/search?type=place&center=50.785361,6.0334127
Used return the search result reliably but suddenly stopped working with the following error:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
I have tested the call on the Graph API Explorer. With my facebook user's access token the request still returns the desired data. Other requests with this app access token still work, so the token is good.
Any ideas?