Facebook Graph Places Search API always fails with 33 code error - facebook-graph-api

I am getting started on Facebook Graph API. I need to use Places Search Product, I have followed a tutorial to create a basic user app (generate user token), and am trying to run this simple request
https://graph.facebook.com/search?
type=place&
center=40.7304,-73.9921&
distance=1000&
q=cafe&
fields=name,checkins,website&
limit=3&
access_token=XXXX
I am always getting this error
{
"error": {
"message": "(#33) This object does not exist or does not support this action",
"type": "OAuthException",
"code": 33,
"fbtrace_id": "XXXXX"
}
}

You did not explicitly specify an API version in your call there, so this uses whatever the default API version for your app is.
Looks like for yours that might be v6.0 already (did you create the app id only recently?) - and with that, things have changed regarding the Places Search API.
There is a new feature called Page Public Metadata Access now, that you have to apply for, before you can use this search.
I tried your request with older apps that still can use lower API versions in Graph API Explorer - and this works fine for API versions v3.0 up to and including v5.0.
Using v6.0, I get the same error message you mentioned.
So, if your app is old enough to still be able to use older API versions, you could do that - at least for the time being. If not, then you will have to submit your app for review of this feature first.

The answer I found after investigations is that Facebook has deprecated places search from Facebook API, u would need to ask for it to use it!

Related

How to implement facebook oEmbed API - Not able to generate App Review

we're customising a white-label CMS solution for a customer and want to allow for facebook/insta embeds. We would like to implement this feature using facebook's and instagram's oEmbed API. However, I am stuck at the point where facebook needs to grant access to that API.
What I've done so far:
Create a fb dev account
Create an App
Go to Graph API Explorer and make test calls --> calling the oEmbed-API, referring to posts from facebook.com/facebook/<somePost> and facebook.com/instagram/<somePost>. I always receive the answer: (#10) To use 'Oembed Read', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Oembed Read' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.
According to fb, "Request advanced access" should be enabled 24h after making a Test API call. Therefore I was hoping that this would allow me to request advanced access for the oEmbed-API (not talking about using the API yet, but just requesting access).
However I am still stuck at that point and cannot request advanced access for any feature. I went through the getting started a dozen times and I am stuck with this ticket for ten days now.
Has anybody recently made good experiences with creating a new App and asking for oEmbed-API access? Which steps did you take?

Getting started using Microsoft Academic Graph API

I am trying to run some queries on Microsoft Academic Graph using their API. I cannot figure out what to use for the Ocp-Apim-Subscription-Key. (I have seen this question and it did not help.) When I try to run queries I get the following message (401: access denied): Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key.. This happens either using curl on the command line:
curl -v -X GET "https://westus.api.cognitive.microsoft.com\
/academic/v1.0/evaluate?\
expr=stochastic&model=latest&count=10&offset=0&attributes=Id" \
-H "Ocp-Apim-Subscription-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
or using the API testing console.
So what am I using for the Ocp-Apim-Subscription-Key? (Not a lot of Xs!) I've tried two things. First, I've tried using the key that you can get by going to https://labs.cognitive.microsoft.com/en-us/project-academic-knowledge and clicking on the subscribe link (either Key 1 or Key 2).
Second, I've tried using a key generated by going to the cognitive services on my azure portal, and trying to create a subscription to a suitable service. However, nothing that I can see matches the Academic Search API that I want to use, so I used a generic bing search subscription.
Neither of these grants me access to the API. What am I missing?
EDIT:
After first response by #ali-heikal, I tried going to here: https://dev.labs.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/5951f78363b4fb31286b8ef4/console. A red warning box appears at top of page: You are not subscribed to this API and will get a '401 Access Denied' response. To subscribe, go to the Products page and click on the desired product containing this API.. If I go to the Products page, and go on to the Project Academic Knowledge - Preview page, I am offered the chance to subscribe. Clicking subscribe takes me to a generic MS sign in (I am signed in, choose that account), I am taken to a page which says:
We're unable to complete your request
Microsoft account is experiencing technical problems. Please try again later.
So this does not work for me. Where is it documented that I should use this endpoint? Can someone provide further instructions on how to use it?
EDIT2:
There is this answer which describes using a different endpoint: https://stackoverflow.com/a/49318405/54557. However, changing my curl request to use this does not work (with same Access denied error).
You're using the wrong endpoint, since you're using the Preview API, then you should use the Preview endpoint as well.
It should work if you follow those steps:
Regenerate a key from here (do not use an old key this time) and confirm by clicking the Yes, regenerate this key button
Open the Testing Console from here
Insert the key you just generated into the Ocp-Apim-Subscription-Key field
Insert the following into the Request body field: expr=Composite(AA.AuN=='ali heikal')&count=2&attributes=Ti,Y,CC,AA.AuN,AA.AuId
Click the Send button
Check the Entity Attributes documentation here to understand the attributes I included following the Evaluate Method documentation here
I think the problem is that you are using an old key with the wrong endpoint and attribute values.

Trying to get information user_friends, user_events, user_managed groups via Facebook Graph API but getting an error message

To start off, sorry, I'm pretty new at this!
I'm an assistant research coordinator at an university, and we've been using Facebook groups to conduct studies. I've been using a set of instructions created by my former colleagues (who have now left) on how to download my Facebook group data (such as comments and posts). It was working fine before, but today, when I was trying to download the information, it has not worked.
Instead, I get this:
{
"error":{
"message": "Unsupported get request. Object with ID '2016101665345495' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "ASWzpxRukCz"
}
}
I suspect it is related to Facebook's new policy on April 4th: "Beginning April 4, 2018, all apps, including those formerly approved, must undergo App Review in order to retain or gain access to the Groups API. For apps currently using the API, review is required once App Review resumes or access will be removed."
I'm a little confused because we're not using an app so I don't understand what kind of permissions could be missing.
All the information you need can be found here: https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes
Access to the Group API is not possible at all right now.
You should also take a look at this link: https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#4-4-2018
Beginning April 4, 2018, all apps, including those formerly approved, must undergo App Review in order to gain access to the Events API, Groups API, and Pages API. Apps accessing the Events API and Groups API will lose access and require review once App Review resumes. For apps using Pages API, review will be required once App Review resumes or access will be removed.
https://developers.facebook.com/docs/apps/review

Facebook API Post Search Deprecated?

I am trying to perform a search via the Facebook API and getting the following error from Facebook - (#11) Post search has been deprecated
URL I am using to query graph:
https://graph.facebook.com/search?q=search_query&type=post&access_token={access_token}
Any ideas why this is happening as I can't seem to find anything about the post search being deprecated?
UPDATE
Graph API v1.0 has been fully deprecated and is no longer available as a workaround. Original answer below for reference.
Yes, version 2.0 of the GraphAPI does not let you search for posts anymore. See the updated documentation.
You can continue to search for posts by changing your API call to:
https://graph.facebook.com/v1.0/search?q=search_query&type=post&access_token={access_token}
I.e. add v1.0/ after https://graph.facebook.com/
As mentioned Niraj Shah, searching by the type "post" is already 'Legacy' API method and could be used with path '/v1.0/search?type=post', BUT there is one more trouble - your application can't use v1.0 API, if it was created after 30th April 2014. So be careful. According this answer.
According to Facebook, "All Facebook-enabled apps will be automatically upgraded to API v2.0 on April 30, 2015. If you have mobile apps, you'll need to update your app well before that date - leaving additional weeks for people to download your update from the store", and "Public post search is no longer available".
Check this for details: https://developers.facebook.com/docs/apps/upgrading

different versions of facebook for location based development?

I am working on an app that uses facebook's check in feature from mobile phones. I have created multiple versions of the app on facebook so that i can keep production, test and development separated. All good. However, all my checkins whether test or dev or prod are going to the live facebook platform leading to check ins like "this is a test" or "blah blah" on live facebook pages. Is there a way to be able to check in but not on these real/live pages? In other words, is there a sandbox or development version where developers can freely update content?
Thanks you guys!
Best,
Sachin
So, as with many other things in life, banging my head against the problem helped a bit. I found out that I can create test users for my app - upto 500 of them. The documentation is at http://developers.facebook.com/docs/test_users/. I was able to create test users for my app, login to facebook with those test users and verify that my actions did not show up on public pages. Phew, now i need to deface these public property no more. :-) When doing this, you need to use the app access token not the regular user accesss token. To get that, follow this link: https://developers.facebook.com/docs/authentication/applications/. The last gotcha I faced was that the second link above states that you should have a parameter named grant_type=client_credentials in your graph request. I kept looking for types of client credentials that i could substitute what i thought was a place holder named "client_credentials". That term needs to go in verbatim. (GOTCHA). Also, twice when I tried to create a user, facebook responded with an error json saying that an "unknown error has occured". I was almost ready to give up... but like i said before, banging head against the problem helps. Facebook responded with a json like so after the third request:
{
"id":"*******1832",
"access_token":"*****",
"login_url":"https://www.facebook.com/platform/test_account_login.php?user_id=*****&n=*****",
"email":"****",
"password":"*****"
}
Hope this helps someone else who might also be looking for this info.