Contents
How do I publish a Facebook post using graph API?
The flow shown in the code below:
- the Facebook SDK is initialized.
- a user logs in and we get a user access token.
- the user access token is used for getting a page access token.
- a post can be published with the page access token 🎉
What can I do with Facebook Graph API?
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.
How do you post programmatically on Facebook?
Set the photo you want to upload as the source parameter (must be local to the server running the code) and make a POST request to /{page_id}/photos using the page access token (NOT the application access token!). So it would be along the lines of: FB. api(‘/{page_id}/photos’, ‘post’, { source: ‘path/to/image.
Can I access Facebook API?
Getting the Access Token: Go to link developers.facebook.com/tools/explorer. Again get back to the same link developers.facebook.com/tools/explorer. You will see “Graph API Explorer” below “My Apps” in the top right corner. From “Graph API Explorer” drop down, select your app.
How to learn how to use the graph API?
If you want to learn how to use the Graph API, read our Using Graph API guide. This endpoint doesn’t have any parameters. The post ID. The admin creator of a Page Post. Only available if there exists more than one admin for the page. Information about the app this post was published by.
How to publish a post in the graph API?
You can publish posts by using the / {user-id}/feed, / {page-id}/feed, / {event-id}/feed, or / {group-id}/feed edges. When creating a Post for a Page if you use a user access token the post will be in the voice of the user that posted it. If you use a page access token, the post will be in the voice of the page.
How does the post function work on Facebook?
The caption of a link in the post (appears beneath the name). If comments are being mirrored to an external site, this function returns the domain of that external site. A description of a link in the post (appears beneath the caption).
Where do I post a post on Facebook?
An individual post in a profile’s feed. The profile could be a user, page, app, or group. This endpoint is supported for New Page Experience. This feature permission may be required.