Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Graph custom action that links to other user

I have question about the beta Open Graph stuffs.

The documentation I am looking at is this https://developers.facebook.com/docs/beta/opengraph/ I successfully define custom objects and actions. However, I cannot figure out how to link current user with other users. For example, say I define a custom action 'kick'. I want the current user to be able to 'kick' one of his/her friends. The closest object I can think of is 'profile', but when I pass user_id, 'http://www.facebook.com/profile.php?id=', or http://graph.facebook.com/, it does not work.

This is the requests I tried

POST https://graph.facebook.com/me/myapp:kick?access_token=abc&profile=http%3A%2F%2Fwww.facebook.com%2F123
POST https://graph.facebook.com/me/myapp:kick?access_token=&profile=123
POST https://graph.facebook.com/me/myapp:kick?access_token=abc&profile=http%3A%2F%2Fwww.facebook.com%2Fprofile.php%3Fid%3D123
POST https://graph.facebook.com/me/myapp:kick?access_token=abc&profile=http%3A%2F%2Fgraph.facebook.com%2F123

This is the response I get

{"error":{"message":"An unexpected error has occurred. Please retry your request later.","type":"OAuthException"}}
like image 707
shendz Avatar asked Sep 29 '11 18:09

shendz


1 Answers

The profile given is for an external website. They call it external profile. Pretty misleading terms.

Kicked a website

As you can see I used the following

curl -F 'access_token=TOKEN' \
     -F 'profile=http://graph.facebook.com/zuck' \
        'https://graph.facebook.com/me/MYAPP:kick'

And it gave the above.

I guess you can fill the external profile with meta info from the Facebook users and it will show alright (for example I can send the profile URL facebook.com/zuck instead), but it seems backwards, inefficient and not the intended usage.

For example feeding it my link.

curl -F 'access_token=TOKEN' \
     -F 'profile=http://facebook.com/username' \
        'https://graph.facebook.com/me/MYAPP:kick'

Kicked myself

But the thing is ... I am not a musician.

It does though seem to look alright in aggregation view.

Aggregation

Which is interesting/weird since one of objects shown in this picture is a Facebook profile, so you would think they would give an example with Facebook profiles as objects.

Graph presentation

Though they did say

We are now extending the Open Graph to include arbitrary actions and objects created by 3rd party apps and enabling these apps to integrate deeply into the Facebook experience

Which most likely means they want you to create arbitrary objects outside of Facebook.

Can you still link to other users?
Yes, but through tagging using tags=FacebookID1,FacebookID2 but it will be in the form of

phwd kicked a musician with Friend1 and Friend2 on [APP NAME]

like image 143
phwd Avatar answered Oct 14 '22 23:10

phwd