Posts tagged with facebook-graph-api

I'm trying to upload a video to af Facebook Page following this Graph API documentation: https://developers.facebook.com/docs/video-api/guides/publishing

I have been able to upload the video and received a video handle in response (step 2).

However, no matter what I try, when doing the final "publish" step (step 3), I get this response:

{     "error": {         "message": "There was a problem uploading your video file. Please try again with another file.",         "type": "OAuthException",         "code": 6000,         "error_data": {             "error": null         },         "error_subcode": 1363019,         "is_transient": false,         "error_user_title": "Video wasn't uploaded",         "error_user_msg": "There was a problem with uploading your video. Please wait a few minutes and try again.",         "fbtrace_id": "AMa9zbs8h3b4omv5wRSfTsf"     } } 

Things I've tried:

  • Making POST request via Facebook Javascript SDK
  • Making POST request via axios
  • Making POST request via axios via CORS proxy
  • Making POST request via the Graph API Explorer
  • Making POST request from a vercel.app host rather than localhost
  • Using both graph.facebook.com and graph-video.facebook.com
  • Posting a variety of video file types and sizes ⠀ Every time, exactly the same response (fbtrace_id changes)

Needless to say, the error message isn't giving me enough information to find the cause of the problem (and waiting a few minutes and trying again later doesn't help).

The request that is being made (via Javascript SDK) is:

curl 'https://graph.facebook.com/v20.0/<PAGE_ID>/videos?access_token=<PAGE_ACCESS_TOKEN>' \   -H 'accept: */*' \   -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \   -H 'content-type: application/x-www-form-urlencoded' \   -H 'origin: https://localhost:3000' \   -H 'priority: u=1, i' \   -H 'referer: https://localhost:3000/' \   -H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \   -H 'sec-ch-ua-mobile: ?0' \   -H 'sec-ch-ua-platform: "macOS"' \   -H 'sec-fetch-dest: empty' \   -H 'sec-fetch-mode: cors' \   -H 'sec-fetch-site: cross-site' \   -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \   --data-raw $'description=Victoria\'s%20nurses%20and%20midwives%20have%20voted%20down%20a%20proposed%2023%25%20pay%20rise%20over%20four%20years%2C%20citing%20uncertainty%20and%20a%20desire%20for%20better%20conditions.&fbuploader_video_file_chunk=<VERY_LONG_VIDEO_HANDLE>&method=post&pretty=0&sdk=joey&suppress_http_code=1&title=Nurses%20Reject%20Offer' 

I suspect the problem has to do with permissions and the Facebook app configuration. I tried to post just a regular Page Post and that was successful. The successful Page Post request was:

curl 'https://graph.facebook.com/v20.0/<PAGE_ID>/feed?access_token=<PAGE_ACCESS_TOKEN>' \   -H 'accept: */*' \   -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \   -H 'content-type: application/x-www-form-urlencoded' \   -H 'origin: https://localhost:3000' \   -H 'priority: u=1, i' \   -H 'referer: https://localhost:3000/' \   -H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \   -H 'sec-ch-ua-mobile: ?0' \   -H 'sec-ch-ua-platform: "macOS"' \   -H 'sec-fetch-dest: empty' \   -H 'sec-fetch-mode: cors' \   -H 'sec-fetch-site: cross-site' \   -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \   --data-raw 'message=Nurses%20Reject%20Offer&method=post&pretty=0&sdk=joey&suppress_http_code=1' 

Other contextual information

  • The Facebook App has not undergone App Review yet, but the User is connected to the Facebook App, so that shouldn't be a problem
  • The User has admin access to the test Page
  • “Business Verification” is complete
  • developers.facebook.com is saying we can’t apply for Access Verification because we don’t need Access Verification.
  • App Type is ‘business’ and App Mode is ‘development’
  • Based on the user access token and the page access token, the permissions are: (same for both)
    • email
    • publish_video
    • pages_show_list
    • pages_read_engagement
    • pages_read_user_content
    • pages_manage_posts
    • pages_manage_engagement
  • Screenshot of Facebook App login configuration:
    • login variation: general
    • access token: User access token
    • permissions: pages_show_list, publish_video, pages_manage_posts, email, pages_read_management, pages_manage_engagement
  • Another possible clue: After uploading the video (step 2) and receiving a video handle in response, I can't see the uploaded video anywhere. I can't see it on any Facebook page (not listed on user's personal page, the business page, as 'cross postable' content in the Creator Studio etc) and when I make a Graph API request for the user's videos, I get an empty array in response. Maybe uploaded videos remain invisible until they are published at least once? Or maybe there's a problem with the upload, despite the successful response from the HTTP request?
  • Facebook does not provide a way to communicate with them about this apart from posting to community forums (no dev support, can’t even raise bug tickets). This problem is also posted at [ Video API ] error_subcode: [...] when publishing video - Developer Community Forum - Meta for Developers, but raising here on S.O. because no response on the other one.

I'm using the Facebook JavaScript SDK to retrieve the comments for a live video (with the page access token), using the following Graph API request:

GET /{live-video-id}/comments 

However, I'm encountering an issue where the "from" field is only available for comments made by users with Tester App roles:

{     "from": {         "name": "Toni Wong",         "id": "26125913430....."     },     "message": "m+1",     "created_time": "2024-07-10T10:10:19+0000",     "id": "992451439....._854049766....." } 

For comments made by other users without any app roles, the "from" field is missing in the response:

{     "message": "s+1",     "created_time": "2024-07-10T10:10:35+0000",     "id": "992451439....._139887616....." } 

My app has the following permissions:

  • public_profile
  • Live Video API
  • instagram_manage_messages
  • pages_manage_metadata
  • email
  • pages_messaging
  • instagram_manage_comments
  • pages_read_engagement
  • business_management
  • instagram_basic
  • pages_read_user_content
  • pages_show_list
  • pages_manage_engagement

Have I missed any necessary permissions or configurations that could be causing this issue?

I want to check who has created a live video on a Facebook page using the Graph API. When I access the feed and select the 'from' field (https://graph.facebook.com/20.0//live_videos?fields=from), it shows that the creator is the same as the page name. I also tried to get the video ID and then find the admin_creator, but it doesn't give me anything. Any ideas on how I can find out who created the live video?

To check the creator of a live video on a Facebook page using the Graph API.

The request I am making is:

[GET] graph.facebook.com/v20.0/[ad_id]/adcreatives?fields=name,url_tags

The Facebook API is bringing me this:

{   "data": [     {       "name": "{{product.name}} XXXX",       "url_tags": "utm_source={{site_source_name}}&utm_medium={{placement}}&utm_campaign={{campaign.name}}&utm_content={{ad.name}}",       "id": "XXXXX"     }   ] } 

I want to translate the url_tags and name fields so that it brings me the real url and name that will be displayed for that creative.

I tried to read the documentation and test all parameters, but I didn't find anything.

I am trying to create an APP ENGAGEMENT campaign using Facebook ads API. I want to optimize (performance goal) the adset based on custom/standard events associated with the app; not based on clicks or app installs.

I am setting optimization_goal as OFFSITE_CONVERSIONS. Inorder to pass promoted_object, the event name is required. Promoted object will be passed as

{    "application_id" : <APP_ID>,    "object_store_url" : <APP_URL>,    "custom_event_type" : <EVENT_TYPE> } 

In Ads manager UI; when I select the app all the events associated with app are displayed. If no events are associated with the app, it's asking to create an event. How to get all these events via Ads API?