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 an 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?
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
You can access Page Insights by typing /insights after the name of your page in the URL field. This command will retrieve all of the Insights associated with your Page. Type "/insights" after your company name. Click the Submit button.
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. For more information visit the Business Help Center.
Facebook has announced support for liking URL's outside of Facebook by using the official built-in Like action. You need to have publish_actions
permissions. The graph url for this is: https://graph.facebook.com/[User FB ID]/og.likes?object=OG_OBJECT_URL&access_token=USER_ACCESS_TOKEN
However, you cannot use this to like a page on Facebook currently, as the documentation states:
For Facebook Pages or websites that do not integrate with Facebook Authentication, developers should continue to use the Like button social plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With