Posts tagged with whatsapp-cloud-api

Problem: I’m using the Meta WhatsApp Business API to send template messages. When I try to send the first message using Postman, I get a 200 OK response, but the message is not delivered to the recipient's phone. However, if the user sends me a message first, the API works as expected, and the message is delivered.

Here is the JSON request I'm using:

{   "messaging_product": "whatsapp",   "to": "91790******",   "type": "template",   "template": {     "name": "hello_world",     "language": {       "code": "en_US"     }   } } 

The response I receive is:

{   "messaging_product": "whatsapp",   "contacts": [     {       "input": "91790******",       "wa_id": "91790******"     }   ],   "messages": [     {       "id": "wamid.HBgMOTE3OTA0NjMwMzM3F***dfdffQkI1QzcwNTd**==",       "message_status": "accepted"     }   ] } 

I’ve confirmed that the template (hello_world) is approved and active. The API request returns a 200 OK response, but the message is still not delivered to the recipient unless they initiate the conversation by sending a message first.

Question: Why is the message not being delivered when sending it as the first message? How can I send the first template message without requiring the user to send a message first?

Additional Details: I’m using the Meta WhatsApp Business API. The template is approved, and the recipient's phone number is valid.

I'm trying to unlink a product catalog from a WhatsApp Business Account (WABA) via the Meta Graph API. Still, I can't find the appropriate API endpoint for this action.

From the Meta Business Manager, I noticed that when unlinking a catalog, the following request is made:

Request URL: https://business.facebook.com/api/graphql/ Request Method: POST { "input": { "waba_id": "WABA_ID_HERE", "catalog_id": "CATALOG_ID_HERE", "action": "UNLINK", "actor_id": "ACTOR_ID_HERE", "client_mutation_id": "" } }

However, this seems to be part of the internal GraphQL API, and I can't find a corresponding endpoint in the official Graph API documentation to unlink a catalog from a WABA.

Is there a specific Graph API endpoint or another method that allows unlinking a product catalog from a WABA through the official Meta Graph API? If so, could you provide details on implementing it or any alternative solution?

Thank you in advance for any help!

Here are the steps I took to get access_token

// Init FB SDK const loadSdk = () => {     window.fbAsyncInit = function () {         window.FB.init({             appId: "218446344509498",             cookie: true,             xfbml: true,             version: "v19.0",         });     };     if (!document.getElementById("facebook-jssdk")) {         const js = document.createElement("script");         js.id = "facebook-jssdk";         js.src = `https://connect.facebook.net/en_US/sdk.js`;         document.body.appendChild(js);     } }; loadSdk(); 

Then I opened the popup that I need for whatsapp embedded sign up

window.FB.login((response) => {     if (response.authResponse) {         const code = response?.authResponse?.code;         console.log(code)     } }, {     config_id: <config-id>, // configuration ID goes here     response_type: "code",     override_default_response_type: true,     scope: 'business_management, whatsapp_business_management, whatsapp_business_messaging', }) 

When I code the code I retrieved my access_token on the server side using the following API

https://graph.facebook.com/v20.0/oauth/access_token?client_id=<client-id>&client_secret=<client-secret&code=<code-i-previously-retrived> 

This returns me an access token that seems to be working with Meta APIs /me, //owned_whatsapp_business_accounts But it returns empty arrays or objects.

When I do the same thing from Meta explorer (select permissions, generate token, copy that token and use, it works)

I have been trying to solve this since many days and not sure where I am doing the mistake.

I want to generate token with correct permissions (it looks like I am doing it because authentication popup also mentions the permissions I requested), and want to able to fetch information from it not empty array

Error performing query

Unable to add admin system user and generate permanent access token for whatsapp api.

Note :- Error performing query

"I'm encountering an issue while trying to add an admin system user and generate a permanent access token for the WhatsApp API. The process fails with an 'error performing query' message. Interestingly, this problem only occurs with the app I'm developing for my second business; the admin system user for my first business works fine. Could this be a problem on Facebook's end? or this is the problem my end "