API Graph Facebook - Creation page User TEST - facebook

I'm trying to use the Graph api to create pages. So I have an application type Entreprise, and a Test User. I tried this:
Post request to [userTest_id]/accounts/
Params:
{
"name": "Test Page One",
"about": "This is the first page created to check the api",
"cover_photo": {
"url": "https://i.etsystatic.com/6293506/r/il/ea9cf8/1809124703/il_fullxfull.1809124703_swn3.jpg"
},
"picture": "https://i.etsystatic.com/6293506/r/il/ea9cf8/1809124703/il_fullxfull.1809124703_swn3.jpg",
"category_list": "[\"174177802634376\"]"
}
I use user token
I get this error:
{
"error": {
"message": "Unsupported post request. Object with ID '[userTest_id]' 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",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "ATSiLLBx2O1yOuPRFxq4r4V"
}
}
I've followed this doc:
https://developers.facebook.com/docs/graph-api/reference/user/accounts/#Creating
What I'm missing plz ?
Thanks.

Facebook API doesn't allow creating Pages in the "real world" scope. You may do it for test users (created on the Role tab) or, in production, you have to get special approval from Facebook (not just permission).

Related

Unsupported post request. Object with ID act_xxxxxxxxx does not exist

I'm trying to create new custom-audience via facebook graph API as it said on page https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences and i'm getting this error
Status: 400
Response:
{
"error": {
"message": "Unsupported post request. Object with ID 'act_xxxxxxxxxx' 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",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "HihUXD8a35/"
}
}
What permission do i need to make successfull API request or what other reasons could cause this error?
Main task is to make an app that would upload user's data as custom audiences from CRM to Facebook Business Manager account. What steps do I need to follow to that successfully?

Facebook ads leads retrieving (GraphMethodException)

https://graph.facebook.com/v14.0/{lead_id}?access_token=
I'm using this endpoint to get lead data from Facebook Ads forms. When I use this tool (https://developers.facebook.com/tools/lead-ads-testing/) to test the form, it goes well. But in real life (for audience), the leadgen_id comming from webhook's body (https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/#webhooks) does not work:
{
"error": {
"message": "Unsupported get request. Object with ID '<leadgen_id from webhook>' 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",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "PzqVPIf..."
}
}
At first, I suspected it could be something related to permission, but this other tool (https://developers.facebook.com/tools/debug/accesstoken) said that all the permissions needed were set:
Image

Error on Facebook official_events Graph API "(#3) Application does not have the capability to make this API call."

I can't get the official_events API to work in the Facebook API.
I made a Facebook app:
App type: Business
Not "Native or desktop app"
Latest API versions
I request an access token with the following permissions. (Probably more then needed but just trying)
public_profile email
pages_manage_posts
pages_manage_engagement
pages_manage_metadata
pages_manage_posts
pages_read_engagement
pages_read_user_content
pages_show_list
I login with myself or with the Facebook OpenGraph API test user.
I created a test page with both users.
I request the pages with access tokens with a call to the "me/accounts" endpoint.
With the page token I can create a message on the test page in the Graph API Explorer:
POST to <page_id>/feed
{
"message": "Hello world"
}
That works! So the page token is working.
Then I want to create an event on the page with the API described here:
https://developers.facebook.com/docs/pages/official-events/
Post to /official-events
{
"name": "test event",
"description": "some description",
"cover": {
"source": "https://testimages.org/img/testimages_screenshot.jpg",
"offset_x": "0",
"offset_y": "0"
},
"category": "FAMILY_EVENT",
"timezone": "US/Pacific",
"start_time": "2022-12-24 17:45:12"
}
But i receive this error:
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "AzueJBRnUjeqZh7vO0RxnG5"
}
}
Does anyone have any idea?

Send messages via Graph API stop working

Am testing this method via Facebook graph api explorer
https://developers.facebook.com/tools/explore
i chose my user and give him access to pages_messaging read_page_mailboxes manage_pages
then choose certain page and method {conversatio_id}/messages with POST request
and send parameter
message: "test test"
I got this response
{
"error": {
"message": "(#210) This call requires a Page access token.",
"type": "OAuthException",
"code": 210,
"fbtrace_id": "C+Xo8LCuuLW"
}
}
Facebook reference
https://developers.facebook.com/docs/graph-api/reference/v2.10/conversation/messages
This is issue reported in Facebook API and fixed now!
https://developers.facebook.com/bugs/261578841015508/

App Access Token can't retrive user public data

In Graph API, if i make a request using a token generated by Graph API Explorer for the following query:
https://graph.facebook.com/v2.2/993673107328394
I get some results:
{
"id": "993673107328394",
"first_name": "Johann",
"last_name": "Gomes",
"link": "https://www.facebook.com/app_scoped_user_id/993673107328394/",
"name": "Johann Gomes",
"updated_time": "2015-01-19T16:00:34+0000"
}
But, when i use an App Access token, an exception is returned to me :
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
This is very strange because the only difference between user and app access tokens seems to be its valid time of use. Any ideas?
Thanks in advance!
It's all in the docs:
https://developers.facebook.com/docs/graph-api/reference/v2.2/user#readperms
There are a number of fields called the public profile which are with public_profile permission.
Fields that aren't part of the public profile must be be requested with an access token with the relevant 'Extended Profile' permissions.
The first bullet point indicates that you have to use a user access token.