Posts tagged with facebook-opengraph

My app was already live in facebook. I had then changed it back to "In development" , to integrate instagram. Although i did spend some time, i did not request for any new permission. I reverted any changes i had done to my developer account. The only change which i cannot revert is to remove Instagram from "Products" in my app.

My privacy policy url was always : https://hype.workflowlabsfusion.com/privacypolicy/index.html

It is accessible. Now when i try to change it to In development mode, facebook keeps giving the error

You must provide a valid Privacy Policy URL in order take your app Live. Go to Basic Settings and make sure it is valid. 

But my url is very much accessible, there is no change in content of the privacy policy. What is possibly going wrong ? I have been trying to resolve this from the past 2 days. Any help would be appreciated. Thanks.

I am currently trying to retrieve likes and comments for my post on facebook graph explorer. I get response bug, there is only my like, those other are missing whereas there is really much more likes.

Retrieving comment, all comments are on the response but, comment's authors are missing whereas I set in the field query.

These are the autorisation I set:

  • pages_show_list
  • pages_read_engagement
  • pages_read_user_content
  • pages_manage_posts
  • pages_manage_engagement

This is the response for likes requests from facebook explorer: /404084156710515_625686649729154?fields=comments{from,created_time},likes{id,name,username}

{   "comments": {     "data": [       {         "created_time": "2023-09-24T04:43:38+0000",         "message": "comment1",         "id": "625686649729154_1692834397884940"       },       {         "created_time": "2023-09-23T14:06:09+0000",         "message": "comment2",         "id": "625686649729154_326839209849302"       },       {         "created_time": "2023-09-22T15:47:49+0000",         "message": "comment3",         "id": "625686649729154_288127333934812"       }     ],     "paging": {       "cursors": {         "before": "NgZDZD",         "after": "MQZDZD"       }     }   },   "likes": {     "data": [       {         "id": "27817357317847681",         "name": "ME"       }     ],     "paging": {       "cursors": {         "before": "QVFIUnRwSFRRc0ZAfLTFVS24wUjRrb1FrZAzMyNzRsU3ZA1RE5MakFvYm42aUptS1EtUzhuWlJXMUlGVHBpd3h5c3pQWHdzMGNNcWlqSkg3UFJxbEdrTG5Kd3BB",         "after": "QVFIUl9wanJEUDdON2tNV1JsRngyakdwZA1c2TENzTE95cUV6RHdGc01EdVhndWdmZAkduc3hWRFBGbTlrRTh3Yjl5YV9IaFV2VDlYcTAwTWxEeTNGdWxuc1ln"       },       "next": "https://graph.facebook.com/v21.0/404084156710515_625686649729154/likes?access_token=<MY_TOKEN>&pretty=0&fields=id%2Cname%2Cusername&limit=25&after=QVFIUl9wanJEUDdON2tNV1JsRngyakdwZA1c2TENzTE95cUV6RHdGc01EdVhndWdmZAkduc3hWRFBGbTlrRTh3Yjl5YV9IaFV2VDlYcTAwTWxEeTNGdWxuc1ln"     }   },   "id": "404084156710515_625686649729154" } 

I appreciate your help, thank you.

I am trying to create A/B test using facebook graph API. The documentation I follow: https://developers.facebook.com/docs/marketing-api/guides/split-testing

The documentation mentions following curl command:

curl \ -F 'name="new study"' \ -F 'description="test creative"' \  -F 'start_time=1478387569' \ -F 'end_time=1479597169' \ -F 'type=SPLIT_TEST' \ -F 'cells=[{name:"Group A",treatment_percentage:50,adsets:[<AD_SET_ID>]},{name:"Group B",treatment_percentage:50,adsets:[<AD_SET_ID>]}]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/<BUSINESS_ID>/ad_studies 

I am able to run this command successfully and get the split test ID which has been created, but I am unable to find the created split test:https://www.facebook.com/test-and-learn The created test is fetch-able through API GET endpoint, but it does not exist on facebook console. Here is the place where I am trying to find it:

My goal is to create facebook ads A/B test through graph API. Is there any other documentation for this? or am I understanding something wrong there?

I'm creating an automation flow with puppeteer to log in to Facebook and get the User Access Token. The code is a NodeJS code and pretty simple for now:

require("dotenv").config(); const { tagmanager } = require("googleapis/build/src/apis/tagmanager"); const puppeteer = require("puppeteer"); (async () => {   // Lança o navegador com a UI visível para que possamos acompanhar o processo   const browser = await puppeteer.launch({ headless: false });   const page = await browser.newPage();   // Define a URL para o fluxo de login do Facebook   const facebookLoginURL = `https://www.facebook.com/v16.0/dialog/oauth?client_id=${process.env.FB_APP_ID}&redirect_uri=${process.env.FB_REDIRECT_URI}&scope=email,public_profile&response_type=code`;   // Vai para a página de login do Facebook   await page.goto(facebookLoginURL);   // Espera o span com o texto específico "Permitir todos os cookies"   await page.waitForFunction(() => {     const elements = Array.from(document.querySelectorAll("span"));     // Verifica se algum elemento contém o texto "Permitir todos os cookies"     const targetElement = elements.find(       (element) => element.textContent.trim() === "Permitir todos os cookies"     );     // Se o elemento for encontrado, retorna true para sair do loop     if (targetElement) {       return true;     }     // Continua o loop se não encontrar o elemento     return false;   });   // Encontra e clica diretamente com page.click()   await page.evaluate(() => {     const elements = Array.from(document.querySelectorAll("span"));     // Verifica se algum elemento contém o texto "Permitir todos os cookies"     const targetElement = elements.find(       (element) => element.textContent.trim() === "Permitir todos os cookies"     );     if (targetElement) {       targetElement.setAttribute("id", "cookie-button"); // Atribui um ID temporário para garantir o seletor     }   });   await page.click("#cookie-button"); // Usa o seletor id para clicar diretamente   // Espera que o campo de email esteja disponível e preenche com o seu usuário de teste   await page.waitForSelector("#email");   await page.type("#email", process.env.FB_TEST_USER_EMAIL);   // Preenche a senha com a senha do usuário de teste   await page.type("#pass", process.env.FB_TEST_USER_PASSWORD);   // Clica no botão de login   await page.click('button[name="login"]');   // Espera o redirecionamento para a URL de callback   await page.waitForNavigation();   // Obtém a URL atual (que deve conter o código de autenticação)   const redirectedUrl = page.url();   console.log("Redirected URL:", redirectedUrl);   //here we need to handle 2FA   //...   // Extraia o código da URL de redirecionamento   const urlParams = new URLSearchParams(redirectedUrl.split("?")[1]);   const authCode = urlParams.get("code");   console.log(`Auth Code: ${authCode}`);   await browser.close(); })(); 

The puppeter code above comprises the following steps:

  1. Open Facebook login page (OK)

  2. Log in with user and password (OK)

  3. Enter 2FA code (not OK)

  4. Get User Access Token (not OK because of 3)

I'm having trouble with step 3, because I don't know how to get the code automatically, i.e. without having to enter it manually. Any solutions?

2FA is enabled in Meta Business Manager and I normally receive this code by SMS or via the Microsoft Authenticator app. I could perhaps disable 2FA for the user in question in the Meta Business Manager, but that's something I wouldn't want to do, as it reduces credibility on the Meta side, which could block the user.

So I'd like to "hear" from you about possible ways of dealing with this. Thanks in advance!

I want to handle with 2FA by using puppeteer to login on Facebook with a normal user account.

I am trying to get all types of post's visible on my feed of all the user's, is their any way to do it.

I tried differnt facebook graph api but they are only retruning me posts made by me.

I have read on multiple post that you can only get the post those are made by you.

I just want all the public post data of my facebook wall