Posts tagged with whatsapi

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´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 am using the WhatsApp Business API to use my chatbot and I needed to connect the Facebook product catalog to the configured WhatsApp number. Does anyone know what I can do to associate a catalog with a WhatsApp account and if it is possible to use the catalog response in the WhatsApp API for consumption? I'm developing a chatbot for restaurants and I wanted the user to be able to place an order through the WhatsApp Business catalog and from there the chatbot would get the rest of the information. I already have a catalog set up and a working WhatsApp number, however, when I associate the menu with the registered phone number, the catalog does not appear on the WhatsApp profile of the registered number.

I am a developer. working on a project where I need to integrate my site with WhatsApp API to send messages. Moreover, I want my various clients can send messages to their respective audiences with their own numbers. How can I achieve that?

I have checked only BSPs can create a WhatsApp Business platform on WhatsApp cloud API. BSPs can provide such a solution. However, there is no mention of how to integrate or embed the form with the website so clients can fill and register themselves.

I want to send an automatic message to a user that completes a webform. As I can't do it from Whatsapp App nor Whatsapp Business App, I had to suscribe to Whatsapp Business Platform (and add a number that can't be used in Whatsapp/Whatsapp Business App). Now I can send message through the API and receive the reply in a webhook. However, I want to have them on the regular app and reply it just from the phone as usual. Can this be done? Or I need to develop a messaging platform just for this?