Posts under category facebook-graph-api

I am trying to send items to commerce catalog using V20 Graph API andI continue to get this error.

"error_user_msg": "Products without \"link\" information can't be uploaded. Please check that this field is included for each product in a separate, labelled column.",

All fields appear to be valid, I just can't get past this error here.

I have tried with API and directly with Graph API Post, both return the same error.

var postData = {     "retailer_id": "TEST_SKU_12345",  // Using a static SKU for testing     "name": "Test Product",     "price": 100,  // Using an integer value for the price     "currency": "USD",  // Default to USD     "link": encodeURIComponent("https://store.casablancawirelessllc.com/g-power-5g?sku=PQPWFV"),  // URL-encoded link     "image_url": "https://b3213372.smushcdn.com/3213372/wp-content/uploads/2023/07/stacks-dark-1.png" // Valid image URL   }; 

I'm setting up the WhatsApp/Meta embedding tool and trying to make it automatically set up everything automatically for programmatic receiving and sending messages to WhatsApp.

The issue I'm facing is that I'm not a valid client code after successful . These are all the steps my application is taking:

Allowing the user to go through the embedding tool At the end, I receive a token from the embedding tool I want to trade it in that token, for an access token but facebook graph api throw an error saying "Malformed access token" or "This authorization code has expired".

     window.addEventListener('message', (event) => {         if (event.origin !== "https://www.facebook.com" && event.origin !== "https://web.facebook.com") {             return;         }         try {             const data = JSON.parse(event.data);             if (data.type === 'WA_EMBEDDED_SIGNUP') {                 // if user finishes the Embedded Signup flow                 if (data.event === 'FINISH') {                     const {                         phone_number_id,                         waba_id                     } = data.data;                     console.log("Phone number ID ", phone_number_id, " WhatsApp business account ID ", waba_id);                     // if user cancels the Embedded Signup flow                 } else if (data.event === 'CANCEL') {                     const {                         current_step                     } = data.data;                     console.warn("Cancel at ", current_step);                     // if user reports an error during the Embedded Signup flow                 } else if (data.event === 'ERROR') {                     const {                         error_message                     } = data.data;                     console.error("error ", error_message);                 }             }             document.getElementById("session-info-response").textContent = JSON.stringify(data, null, 2);         } catch {             console.log('Non JSON Responses', event.data);         }     });          const fbLoginCallback = (response) => {         if (response.authResponse) {             const code = response.authResponse.code;             // The returned code must be transmitted to your backend first and then             // perform a server-to-server call from there to our servers for an access token.             FB.api(                 "/debug_token?input_token=" + code,                 function (response) {                     if (response && !response.error) {                         /* handle the result */                         console.log(response);                         console.log('here12')                     }                      }             );         }         document.getElementById("sdk-response").textContent = JSON.stringify(response, null, 2);          }          const launchWhatsAppSignup = (e) => {         event.preventDefault();              // Launch Facebook login         FB.login(fbLoginCallback, {             config_id: '1707717083377865', // configuration ID goes here             response_type: 'code', // must be set to 'code' for System User access token             override_default_response_type: true, // when true, any response types passed in the "response_type" will take precedence over the default types             scope: "business_management, whatsapp_business_management, whatsapp_business_messaging",             extras: {                 setup: {},                 featureType: '',                 sessionInfoVersion: '2',             }         });     }     window.fbAsyncInit = function () {         FB.init({             appId: '521724357037484',             autoLogAppEvents: true,             xfbml: true,             version: 'v20.0'         });     };                               

I have the permissions public_profile, email, pages_read_engagement, instagram_basic, instagram_manage_insights, pages_show_list, read_insights, business_management. When I make a request to the API https://graph.facebook.com/v19.0/{your-user-id}/accounts?access_token={user-access-token} using a user ID and user access token, I sometimes get account data for some users, but for others, I receive empty data.

I encountered this issue before adding the business_management permission. After adding that permission, everything worked fine, but starting yesterday, users have been notifying me that they can't get account info.

I'm try to access Facebook API and when I try to choose get page access token in Graph API Explorer because user access token only gives permission to email. But it gives error :

    Error Invalid Scopes: manage_pages, pages_show_list. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions 

but in the doc it says

If your app is in development, you can grant your app any permission and your queries respect them for data owned by people with a role on your app. If your app is live, however, granting a permission that your app has not been approved for by the App Review process causes your query to fail whenever you submit it.

my app in development mode too.

This is the Error:

Anyone know a fix?