I am trying to use the facebook graph API to post to a facebook group that I am the admin of.When I make the POST request,I am getting a 403 access denied error. This indicates some problem with authentication, I believe. I have made sure my user token is valid and that I am asking for the correct permissions. Here is my code handling the request and handling the user permissions:
Request:
$.ajax({url: `https://graph.facebook.com/766394103749626/feed?message=This%is%my%message&link=https://google.com/&access_token=ValidAccessToken`,
method: "POST"})
Permissions
user_friends, user_posts, groups_access_member_info, publish_to_groups
Related
I created a Facebook account and I want to create a post with Facebook graph API by creating an http request from a C# server.
I created an app with Facebook developer:
I tried to create a post with Facebook's Graph API Explorer as explained in
https://developers.facebook.com/docs/pages/publishing/
I generated a token with pages_show_list and pages_read_engagement permissions. The app ID is the result GET request for "https://graph.facebook.com/v11.0" which returned an object with id property.
The POST request URL is: "https://graph.facebook.com/v11.0/{appId}/feed?message=hi&access_token={accessToken}"
I don't understand why I'm getting 200 status code and how can I fix it.
The error is:
(#200) If posting to a group, requires app being installed in the group, and \
either publish_to_groups permission with user token, or both pages_read_engagement \
and pages_manage_posts permission with page token; If posting to a page, \
requires both pages_read_engagement and pages_manage_posts as an admin with \
sufficient administrative permission",
As you can read in the docs, you need the following:
The pages_manage_posts permission
The pages_read_engagement permission
A Page access token requested by a person who is able to perform the CREATE_CONTENT task on the Page that is being queried
You are missing number one and number three, as far as I can see in your screenshot.
Btw, you can just use "/me/feed" instead, the ID is not neccessary as the Token includes it.
I have a website which should list all the events from my facebook group. So I created a facebook dev account and created an app.
When I tried to get the data with the graph API explorer it worked, but the access token expired after a few hours. So I had to get a never-expiring access token.
I created a sytem user at the facebook business manager. With the system user I got a never-expiring access token but I couldn't get the event data anymore. Everytime I tried it I got this response.
"Unsupported get request. Object with ID 'xxxxxxxxxxxxx' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api"
I have the following permissions as system user:
read_insights, read_audience_network_insights, manage_pages, pages_manage_cta, pages_show_list, publish_pages, business_management
Why did it fail? Are the permissions correct?
Thanks for your help.
I am using the Facebook API Graph Explorer to figure something out.
I am using a user access token with rsvp_event and user_event permissions. I try the url: /321580178346472/interested to set myself as interested in this event.
This event id is for an event that I am the admin of the page for.
Why I am I getting a #200 error for this?
Facebook Graph API with error
You are using GET. Change it to POST instead.
I´m using API Grapgh Facebook trying to Post in the Wall of a {User-id}.
I use this:
POST /v2.3/{user-id}/feed HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+message
with the token for the application.
It returns "(#200) The user hasn't authorized the application to perform this action" but the user-id has permission "publish_actions".
I don't know why I have not permission
You cannot post to another user's wall without their permissions to your app.
Post on your wall with user access token, tag your friend see example here
I have a question, I'm trying to post on a page with the token acquired from
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
I guess the app has permission to post on that page, but when I try to post I get the following error
{
"error": {
"message": "(#200) The user hasn't authorized the application to perform this action",
"type": "OAuthException"
}
}
How do I verify the permission?
Basically, I want to be able to post to a page as a page without asking user to login, Would be great if someone can help me out!
The token that you are acquiring is an App Access Token.
And to post on a page as a page itself, you need a page access token.
To get the page access token, you need to make the following API call with an access token with manage_pages permission:
/{page-id}?fields=access_token
this will give you the page access token for your pages. Use that and publish the post.
You can also have a never-expiring page access token. To get one follow this: What are the Steps to getting a Long Lasting Token For Posting To a Facebook Fan Page from a Server