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

Tag:php, whatsapp, whatsapp-cloud-api

Add a new comment.