Posts tagged with whatsapp-cloud-api

I'm trying to use the API to send to myself a custom message, I can already send a hello world template, but I been unable to send myself a custom only text message.

//API token given by Meta         $token = '*private*';         //Reciever number of msg         $telefono = '*private*';         //URL of msg given by Meta         $url = '*I think is private too*';         $mensaje = '{"messaging_product": "whatsapp", "to": "'.$telefono.'", "type": "text", "text": {"preview_url": false, "body": "MESSAGE_CONTENT" }}'; //header of msg $header = array("Authorization: Bearer " . $token, "Content-Type: application/json"); 

so that's what I use to make the Curl to send the message, which I do like this

//curl init         $curl = curl_init();         curl_setopt($curl, CURLOPT_URL, $url);         curl_setopt($curl, CURLOPT_POSTFIELDS, $mensaje);         curl_setopt($curl, CURLOPT_HTTPHEADER, $header);         curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);         //get response from information sent         $response = json_decode(curl_exec($curl),true);         //print response         print_r($response);         //get curl response code         $status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);         print_r($status_code);         //close curl         curl_close($curl); 

I think is kind of working, because it shows on screen this result

Array ( [messaging_product] => whatsapp [contacts] => Array ( [0] => Array ( [input] => phone [wa_id] => 56994134989 ) ) [messages] => Array ( [0] => Array ( [id] => i think is private too ) ) ) 200

In the end I just need to test if its possible to send myself custom text messages, the thing is that this code isn't working as I want it to, as you should see, on the print of the result and the status_code, the code is 200 what makes me think that the request is going through at some point but maybe it need something else to finally be sent to my phone.

I have a Meta App for using WhatsApp Business Platform. So I follower every instruction on the official docs (https://developers.facebook.com/docs/whatsapp/business-management-api/get-started#1--acquire-an-access-token-using-a-system-user-or-facebook-login):

  • Added a system user
  • Gave administrator permissions
  • Created the bearer token
  • Assigned the app as an asset and gave total permission
  • On WhatsApp account I added the system user and gave total permission.

Yet I get (#200) You do not have permission to access this field on every request! Or similar error messages. What else do I need to do?

EDIT: Im trying to send a message https://graph.facebook.com/v18.0/{my phone id}/messages and the exact message Im getting there is You do not have the necessary permissions required to send messages on behalf of this WhatsApp Business Account and error code 200.

I used the Access Token Debugger and these are my permissions business_management, whatsapp_business_management, whatsapp_business_messaging, public_profile so it should be fine.

Also, I checked that my user has a role in the app, and it's an administrator.

I´m testing the official WhatsApp Business API by Meta, and want to receive the messages that i send to the users through the webhook, because the logic on my program manage the messages that way (I´ve been using Ultramsg and they send a webhook event whenever i send a message to a user).

Could be because i´m using the test phone number provided by meta, or is it always like that?

I tried subscribing to every webhook event available but none of those seem to send the object that i need.

I'm a software developer, trying to create a football tracking application for one of my client. The aim of this application is to send signals when conditions are met. These signals are sent with Twilio sandbox at the moment. Recently we upgraded to the pro version of Twilio in order to create a WhatsApp API Business sender. The Twilio phone Number is an american One but we are located in Italy. The creation process is now stuck, because Meta is asking us to verify the business, but since my client does not have a company for this, we don't have one.

Does someone know how to solve this issue?

I already tried to link his Instagram business account but without any results.

We have agents that are receiving requests to buy products over whatsapp groups. A group includes many agents from many companies, all competing for the same business. We would like to capture the messages that are posted to these groups and send them to our CRM via an API so we can process them quickly. How can this be achieved?