FQL NoIndexFunctionException error 605 on an indexable column - facebook

I'm attempting:
SELECT developer_id FROM app_role WHERE application_id='MY APP ID'
Using a valid token, checked using https://developers.facebook.com/tools/explorer
I receive this back:
{
"error": {
"message": "Invalid application_id in WHERE clause",
"type": "NoIndexFunctionException",
"code": 604
}
}
Now. the application_id is definitely correct. The auth token is checked and associated with that app id, and as far as I can see application_id is totally indexable.
Any ideas what the grief is here? Thanks.

That's because you need an app access token. Get it this way:
GET https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&client_secret=YOUR_APP_SECRET
&grant_type=client_credentials
Source: https://developers.facebook.com/docs/opengraph/howtos/publishing-with-app-token/
Then, use the same FQL request:
SELECT developer_id FROM app_role WHERE application_id='MY APP ID'
And there you go:
{
"data": [
{
"developer_id": "1234567890"
},
{
"developer_id": "9876543210"
}
]
}

Related

Failed to change azure account password from MS Graph Explorer

I am trying to change my password of Azure account from Microsoft Graph Explorer by using this query:
POST https://graph.microsoft.com/v1.0/me/changePassword
{
"currentPassword": "XXX",
"newPassword": "XXX"
}
I got the below error while executing that query:
{ "error": { "code": "Authorization_RequestDenied", "message": "Access
to change password operation is denied.", "innerError": { "date":
"2022-07-10T05:59:39", "request-id":
"1ecc339e-62f4-4703-9e92-181f894b9790", "client-request-id":
"b353d155-13c2-0809-4d83-efb8ae999742" } }
Do I need permission to change my own password? What's the resolution?
I tried to reproduce the same in my environment and got the same error as below:
POST https://graph.microsoft.com/v1.0/me/changePassword
Body
{
"currentPassword": "XXXX",
"newPassword": "XXXX"
}
Please note that, you need Directory.AccessAsUser.All permission consented like below:
After consenting, I am able to change my password successfully like below:
Reference:
user: changePassword - Microsoft Graph v1.0 | Microsoft Docs

I am using ngOpenFB on an ionic app, but I dont manage to get user's email

Login seems to go ok, with the email permission,
however when doing:
var deferred = $q.defer();
$openFB.api({
path: '/me/email'
}).then(function( res ) {
deferred.resolve(res);
//angular.extend(me, {picture: res.data.url});
}).catch(function(err){
console.log(err);
deferred.reject(err);
});
I get an error wrong path.
Ben
/me/email is not a valid endpoint. This is how you get the email of a user: /me?fields=email
The error (from the API Explorer):
{
"error": {
"message": "Unknown path components: /email",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "FBdZx0Yntxz"
}
}

Cannot delete Facebook some test users

When I call:
$ curl 'https://graph.facebook.com/v2.2/<APP_ID>/accounts/test-users?access_token=<APP_ACCESS_TOKEN>&limit=500'
I see 82 accounts, and all but one look like this:
{
"id": "1413484435585065",
"login_url": "https://developers.facebook.com/checkpoint/test-user-login/1413484435585065/"
}
That is, they have no access token.
When I try to delete them I get:
$ curl -XDELETE 'https://graph.facebook.com/v2.2/1413484435585065?access_token=<APP_ACCESS_TOKEN>'
{
"error": {
"message": "(#100) Invalid value specified for param: id",
"type": "OAuthException",
"code": 100
}
}
The only one that DOES have an access token returns:
{
"error": {
"message": "(#2904) You cannot delete the Open Graph Test User for your app.",
"type": "OAuthException",
"code": 2904
}
}
If I go to Roles...Test Users on the Developers page of the app, then it is empty!
Any new test users I create I can see on the Developers page, and I can delete them using the mentioned curl call.
Where could these test users come from, and how do I get rid of them? Or at least filter them when I am listing test users.

an unknown error occured while processing request to facebook graph api

i'm trying to send some likes on facebook page post but for firstt time i notice that error and don't know the reason
request:
https://graph.facebook.com/479322648852908/likes?access_token=CAAEYj0oZAmMsBAHmBWezCtiPfBZAHnOTyzblZB1YxvBbXFZC88ybqS2LlNTwWdsKRECdqZC7A1WEnSVqZCSlt0ftAs8YYmrLtJurIfd5BIotlf1DdMymD1ZBBF9ayYlLrCs1h7JHkRP6PZBv6M2oQpjWVoKPYTufdgdagto3blt2styL2XpYFBsVdmwlmNEQOBwZD&method=POST
Response:
{
"error": {
"message": "(#1) An unknown error occurred",
"type": "OAuthException",
"code": 1
}
}
Any hint ?
I think you can get away without the access token via the url:
http://graph.facebook.com/479322648852908/likes

Facebook API How To Get All Pages I Like Without Pagination

If I like more than 100 pages/things, FB.API('me/likes') returns 99 items and a link to the next paging.
Is it possible to get ALL without the pagination?
Thanks
Have you tried /me/likes?limit=999 ?
You may still need to paginate, but you should be able to get more than 99 items in a single call
Use FQL:
$fql = "SELECT page_id from page_fan where uid = me())";
$pages_i_liked = $facebook->api(array(
'method'=> 'fql.query',
'access_token' => $access_token,
'query'=> $fql,
));
print_r($pages_i_liked);
Get All facebook pages of a user using facebook api
required permissions: manage pages
type: GET
url: https://graph.facebook.com/me/accounts
param: access_token
responce of the above request like this
{
"data": [
{
"category": "Book",
"name": "Mind blowing books",
"access_token": "CAACEdEose0cBAFRU2j0rGgNxBcJvU0pkZCpDbI7rZCJNmO2cZAfZBXoejoZCdTVdKi4gNCyBuu9fPRnWRAwCKrmkPePzKHoE5e46Jz7gRDYe3PM5ECm0ZC5OZB2iWLeEh3OZBgTGfWDmQbbFivwlp5v2umc0CcC9JlTvHsWDnTZCkKIbZAJeD2nOus1ZCCXMqSXHOAZD",
"perms": [
"ADMINISTER",
"EDIT_PROFILE",
"CREATE_CONTENT",
"MODERATE_CONTENT",
"CREATE_ADS",
"BASIC_ADMIN"
],
"id": "618353601555775"
}
],
"paging": {
"next": "https://graph.facebook.com/100000328561058/accounts?access_token=CAACEdEose0cBADKMTNRBl5pjNhw8xsKnQf57XKShV7UlhGyJy67bBZCUKkepl9rELlxqq0I474f8LEPGnt51Mdgs0MMtgTycuUgkOyRnLgVypWVpBd7oKy3LXrrbsQWSdIUZBU4qKHLxSb14TP8ySOaZChLseseYMr1YMLG3qrJiWLuwWJeVz2PeE8TmkkZD&limit=5000&offset=5000&__after_id=618353601555775"
}
}
Post at specific facebook page of a user using facebook api
required permissions: piblish action
type: Post
url: https://graph.facebook.com/{PAGE_ID}/feed
param: access_token, message
this http request will write your message on fb page
PAGE_ID: its page id which is in responce of first request
The maximum results limit is 100
"I just noticed this while counting the results and also next page query, if I insert limit 999 for example, the exact results will be shown as 100 and the next link generated by facebook will contain the limit value also 100"
With this class from Github: FacebookLikedPagesAPI you can get all ID liked pages on Facebook without pagination
$access_token = '';// your access token here
$likes=new Likes();
$result=$likes->getAllLikedPages($access_token);