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

偶尔善良 提交于 2019-12-04 12:47:19

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/9821375/facebook-open-graph-api-action-type-object-type-of-another-application-four

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!