Posts under category Meta & Facebook

There seems to be a bug in the facebook marketing api v20.0

When you try to create AdSet with IMPRESSION as an optimization goal for the campaign objective as OUTCOME_TRAFFIC, the api always returns

{ "error": { "message": "Invalid parameter", "type": "OAuthException", "code": 100, "error_data": "{"blame_field_specs":[["optimization_goal"]]}", "error_subcode": 2490408, "is_transient": false, "error_user_title": "Performance goal isn't available", "error_user_msg": "You can't use the selected performance goal with your campaign objective. Please select a different goal or edit your campaign.", "fbtrace_id": "AemKqGCO7_RymPyjuXcJJYp" } }

I tried from both facebook business sdk of v20.0 and using graph url v20.0

https://graph.facebook.com/v20.0/act_12xxxxxxxx/adsets?access_token=EAAwpjCkZBW7YBO4CSJex2ek2whxxxxxxxxxxxxxxxxx

There is no problem with v19.0 and v18.0

Has anyone came across this problem?

I'm experiencing an intermittent issue when calling Facebook Graph API endpoints from my server and localhost using the Node Facebook SDK. The error message I receive is:

Error:

Message: "An unknown error has occurred." Code: 1

There's any more useful information in the error nor in the response headers.

This error happens sporadically and, when it occurs, it can last for several hours or even days. I’m unable to reproduce it consistently.

**Interestingly, when I make the same API calls through Postman or the Graph API Explorer, everything works fine without any errors. ** Has anyone encountered this issue before or have insights on why this might be happening? Any suggestions on how to troubleshoot or resolve this would be greatly appreciated!

Thank you!

I inspected the facebook error response searching for any more information about the error, but there's any


This happens to me with different requests. See an example:

https://graph.facebook.com/v20.0/campaign-id-example/adsets?fields=optimization_goal%2Cpromoted_object&access_token=xxxx

hello guys im trying to automate a stories video post on facebook but dont know what im doing wrong, my picture stories function works fine but my video one is not working at all!!! i tried to look over here and documentation for a answer but couldnt find a solution! in the first 10 calls i was getting errors from graph and from now on i keep getting erro 500! does anyone knows what i can be doing wrong?

    function postStoriesVideoFacebook($fb, $pageId, $pageAccessToken, $mediaUrls){         $mediaUrls = 'https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4';        // Etapa 1: Inicializar a sessão de upload        $response = $fb->post("/{$pageId}/video_stories", [         'upload_phase' => 'start',     ], $pageAccessToken);     $initData = $response->getDecodedBody();     $videoId = $initData['video_id'];     $uploadUrl = $initData['upload_url'];     // Debugging - Verificando as variáveis     var_dump($initData, $videoId, $uploadUrl);     // Etapa 2: Fazer upload do vídeo usando a URL remota     $ch = curl_init();     curl_setopt($ch, CURLOPT_URL, $uploadUrl);     curl_setopt($ch, CURLOPT_POST, true);     curl_setopt($ch, CURLOPT_HTTPHEADER, [         "Authorization: OAuth $pageAccessToken", // Passando o token como OAuth         "file_url: $mediaUrls"     ]);     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);     $uploadResponse = curl_exec($ch);     curl_close($ch);     $uploadData = json_decode($uploadResponse, true);     // Debugging - Verificando a resposta do upload     var_dump($uploadData);     if (isset($uploadData['success']) && $uploadData['success'] === true) {         // Etapa 3: Publicar o vídeo nos Stories         $finishResponse = $fb->post("/{$pageId}/video_stories", [             'upload_phase' => 'finish',             'video_id' => $videoId,         ], $pageAccessToken);         $result = $finishResponse->getDecodedBody();         // Debugging - Verificando a resposta da publicação         var_dump($result);         if (isset($result['success']) && $result['success'] === true) {             return $result['post_id']; // Retorna o ID do post se a publicação for bem-sucedida         } else {             throw new Exception('Erro ao publicar o vídeo nos Stories.');         }     } else {         throw new Exception('Erro ao fazer upload do vídeo.');     } } 

forums , using direct the cURL options, postman etc

I've been using the Instagram Graph API to fetch comments, but recently (since 8/28) the username field is no longer being returned in the response. I'm using Facebook Login for Business with the following permissions: instagram_basic, instagram_manage_comments, pages_read_engagement, pages_show_list. Any suggestions?
https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-comment

I'm developing an application to capture leads from a Facebook lead form. Here's what I've done so far:

  1. I created an App in the Facebook Developer Dashboard.
  2. I verified the webhook for this app, and the verification was successful.
  3. I have obtained advanced access for the following permissions: leads_retrieval, pages_show_list, pages_manage_metadata.
  4. I have enabled the User object and subscribed to leadgen events.
  5. I tested the webhook, and it's sending test leads in the response as expected.
  6. My app is in Live mode.

However, when a real lead is created on Facebook, I'm receiving the following response instead of the actual lead data:

{   "entry": [     {       "id": "0",       "time": 1724921046,       "changes": [         {           "field": "leadgen",           "value": {             "ad_id": "444444444",             "form_id": "444444444444",             "leadgen_id": "444444444444",             "created_time": 1724921046,             "page_id": "444444444444",             "adgroup_id": "44444444444"           }         }       ]     }   ],   "object": "page" } 

What could I be doing wrong, and how can I start receiving real lead data instead of this mock response?

this is screen shot of my app:- App details:- Permission Details:- Webhook Details:-