Posts tagged with whatsapp

I'm trying to work with the WhatsApp business API, but When I try to send a message, always gives me this error with http code 400:

"message": "(#100) Tried accessing nonexisting field (messages) on node type (WhatsAppBusinessPhoneNumber)",

URL:

https://graph.facebook.com/v17.0/NUMBER_ID/messages?access_token=**ACCESS_TOKEN** 

Body:

{     "messaging_product": "whatsapp",     "to": "5**39&&&&&&1",     "type": "template",     "template": {         "name": "hello_world",         "language": {             "code": "en_US"         }     } } 

Response:

{     "error": {         "message": "(#100) Tried accessing nonexisting field (messages) on node type (WhatsAppBusinessPhoneNumber)",         "type": "OAuthException",         "code": 100,         "fbtrace_id": "Ai8BDTgVwlWuJo6QeTmqRB7"     } } 

I am having trouble to add a reaction to a message through the whatsapp API. I am receiving an good response like the one in the docs

I am posting to https://graph.facebook.com/v18.0/{fromNumber}/messages with the following data:

{   "messaging_product": "whatsapp",   "to": {toNumber},   "type": "reaction",   "reaction": {     "message_id": {messageID",     "emoji": "💭"   } }

And receiving a good response:

{   "messaging_product": "whatsapp",   "contacts": [     {       "input": {toNumber},       "wa_id": {toNumber}     }   ],   "messages": [     {       "id": {responseWaId}     }   ] } 

But sadly no reaction to the message is given

I am using PHP:

/**  * Markeer bericht met reactie  *  * @param string $toNumber  * @param string $message  * @return int  */ public function markMessageWithEmoji(string $messageId){     $url = "https://graph.facebook.com/v18.0/{$this->fromNumber}/messages";     $response = Http::withHeaders([         'Authorization' => 'Bearer ' . $this->whatsappToken,         'Content-Type' => 'application/json',     ])->post($url, [         'messaging_product' => 'whatsapp',         'recipient_type' => 'individual',         'to' => $this->toNumber,         'type' => 'reaction',         'reaction' => [             'message_id' => $messageId,             'emoji' => '💭',         ],     ]);     return $response->status(); } 

I am sure the message id is correct, since I use the same ID to set the received message as read and this works as expected

I'm curious if Twilio has any plans to support the creation and sending of carousel templates for WhatsApp, as outlined in Facebook's documentation: Carousel Templates.

In the meantime, is there a way to create and get approval for these templates directly through WhatsApp Business API (WABA) and then, once approved, send them via Twilio?

Thanks for any insights or guidance!

I`m would like to send a carousel using twilio.

I'm trying to get notified about my contacts' status(picture & video) changes on whatsapp using whatsmeow go library. The library doesn't specifically mention this feature on the documentations. Does anyone know if this feature is supported or if there is a work around for it? Also does this comply with whatsapp terms of services or no?

I tried to check whatsapp web client and their business api but I could not find a clue.

I am building a website in which i want that when a user places an order, store owner should receive the order details in his whatsapp. Like First and last name, address, email, mobile and products which he purchased. Currently i tried Twilio for this purpose, but i don't want to use any 3rd party for this. I want to use only CORE PHP and whatsapp business api or library to achieve this.

Here is what i have done so far.

`<?php require 'vendor/autoload.php'; use Twilio\Rest\Client; $accountSid = '0000-0000-0000-0000-00000'; $authToken  = '0000-0000-00000-00000-00000'; $twilioNumber = 'whatsapp:+12000000000';  $whatsappNumber = 'whatsapp:+1255844885454';  $firstName = $_POST['first_name']; $lastName = $_POST['last_name']; $address = $_POST['address']; $townCity = $_POST['town_city']; $mobile = $_POST['mobile']; $totalprice = $_POST['totalprice']; $orderDetails = "First Name: $firstName\nLast Name: $lastName\nAddress: $address\nTown/City: $townCity\nMobile: $mobile\nTotal Amount: Rs$totalprice"; $client = new Client($accountSid, $authToken); try {     $message = $client->messages->create(         $whatsappNumber,         array(             'from' => $twilioNumber,             'body' => $orderDetails         )     );     header("Location: checkout.php");     exit(); } catch (Exception $e) {     echo 'Error: ' . $e->getMessage(); } `