Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Open Graph API - action-type & object-type of another application (foursquare)

I am trying to retrieve a user's foursquare checkin data that is published using the open graph to Facebook. I am generally having trouble finding information (namespace, action-types and object-types) about an application that I do not own.

So far my application has successfully asked the user for (what I believe are) the appropriate permissions to access data that they have submitted to the foursquare FB application:

user_actions:playfoursquare

I found 'playfoursquare' from the url when I visit a foursquare application page in the new timeline:

http://www.facebook.com/[my_username]/app_playfoursquare 

Now I am trying to query the Graph Api using a url with the following structure: (ref: http://developers.facebook.com/docs/opengraph/objects/#retrieve)

GET /me/{namespace}:{action-type}/{object-type}

Now, in the meta data of a foursquare venue page I found a og:type of 'playfoursquare:venue'.

So far I have what I suspect are the namespace and object-type. I'm just short and action-type.

From a user's foursquare application page on Facebook (http://www.facebook.com/[my_username]/app_playfoursquare) there is a lot of references to 'check-ins' so I have made an assumption about the action-type and concluded that the graph api request should be:

me/playfoursquare:{checkins,check-ins,check_ins}/venue 

I tried all above variations of 'check in' and they all return:

OAuthException - Unknown path component - 2500

I can't believe that this detective work is the best way to determine the properties of another application on the Open Graph. I guess I am missing something obvious.

Either way I would appreciate any help anyone can offer here. I'm at a bit of a loss.

Thanks, Gfte

like image 380
gfte Avatar asked Mar 22 '12 11:03

gfte


People also ask

What type of API is Facebook?

What is the Facebook API? The Facebook Graph API is an HTTP-based API that allows developers to extract data and functionality from the Facebook platform. Applications can use this API to programmatically query data, post in pages and groups, and manage ads, among other tasks.

Is Facebook Graph API a REST API?

The Legacy REST API is in the process of being deprecated, while the Graph API is the most current, so if you're unsure of which one to use, your best bet is to go with that one. As you suggested, the Graph API, just like the Legacy REST API, is in fact a RESTful API.

Is Facebook Graph API deprecated?

Applies to all versions. Facebook Analytics will no longer be available after June 30, 2021. Additionally, we are deprecating the App Dashboard Plugin for Marketing API.


1 Answers

Yes, currently, while its easy to find the namespace of another application (inspect some html, look at URLs) - its not possible to find the action names used by another app - you have to guess.

But for Foursquare, after doing some trial and error myself, I've been able to determine that their current actions are GET-able at the following URLs:

https://graph.facebook.com/me/playfoursquare:checkin_to?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:became_the_mayor_of?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:unlock?access_token=TOKEN

once you have the user_actions:playfoursquare and/or friends_actions:playfoursquare permissions.

like image 138
Simon Cross Avatar answered Oct 31 '22 00:10

Simon Cross