views:

83

answers:

1

Using the graph api I'd like to be able to have an authorized user "like" a page.

I tried posting the following: https://graph.facebook.com/${PAGE_ID}/likes?access_token=${ACCESS_TOKEN}

And I get http error 500 accompanied by "Invalid post_id parameter" in the json response body. Looks like the "/likes" resource is suited to liking a wall post and not a page. How do I get this to work with a page?

A: 

I believe this is not allowed except for specific partner sites, like yelp. The reason is security, you would be able to put some javascript on a page and have everyone that visits that page "Like"ing it without their knowledge.

See How do I "Like" a URL? on the Facebook Platform Developer Forum

Luke
Well not really - the graph api makes use of an access token to prevent that sort of security problem by asking the user to explicitly give access to the facebook application. Anyway I solved the issue by going facebook's preferred route of embedding an iframe to their like button (open graph api).
Tom Wells
"Like"ing (through iframe or fbml) is not an application so no additional permissions are required, all that is required is that you are logged into facebook. I'm still looking for a way to have a custom Like button not in an facebook hosted iframe.
Luke

related questions