Posts tagged with whatsapp-cloud-api

I am trying to use Meta Cloud API to send an image as whatsapp message, but I don't want to upload it anywhere, can't i just send the binary buffer?

something like this:

const formData = new FormData(); formData.append('messaging_product', 'whatsapp'); formData.append('recipient_type', 'individual'); formData.append('to', content.to); formData.append('type', 'image'); formData.append(     'file',     content.image_buffer,     {         filename: 'image.png',         contentType: 'image/png',     } ); 

I was using a service (Business Solution Provider) that allowed me to send the image directly as binary buffer. Now i will use Meta Cloud API, but didn't find anything like this in the docs

enter image description hereI am learning web programming. I am working on adding whatsapp webhook to my web app. My understanding: In my web app, i implemented sending a whatsapp message template programmatically. When a client replies, i want to be able to receive and reply to the client. I followed the tutorial on https://business.whatsapp.com/blog/how-to-use-webhooks-from-whatsapp-business-api in combination with the tutorial in https://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-webhooks#sample-app-endpoints.

My endpoint has be verifyed usefully. But when i send test message, i do not receive any message in my database. I was expecting the when i send test message/when client sends whatsapp message, which show successful, i should receive it in database.

whatsappcontroller.php

public function handleWebhook(Request $request){         $body = json_decode($request->getContent(), true);         if ($body['field'] !== 'messages') {             // not from the messages webhook so don't process             return response()->json([], 400);         }         foreach ($body['value']['messages'] as $message) {             $review = new Whatsapp();             $review->phonenumber = $message['from'];             $review->review = $message['text']['body'];             $review->save();         } 

Route.php

Route::post('/webhooks', [whatsappController::class, 'handleWebhook']); 

What am I not doing good or what do i need to understand about webhook. Because i am expecting that when messages are saved in database, then i can now use a get request url to get all the messages in my web page. Or is this not possible?

enter image description here

I've created a Meta app and got a Whatsapp test number. I can write to it and it is send to the webhook fine. But I'd like to add that number to a group so others can send messages to it as well, without necessarily needing to add that weird number.

When trying to do so it says that Business number can't be added to a group.

Is there something I can do? Am I forced to add my own number to the app and convert it to a Business number?

I'd rather not, I'd like to keep mine personal

Recently I was exploring Graph APIs(https://developers.facebook.com/docs/graph-api/overview) offered by Meta, while checking through couple of APIs like /message-id and /conversation-id for whatsapp message which I sent to one of my contact number (this contact number I am using as customer number) this APIs are working, instead they are showing error message as follows 'Unsupported get request. Object with ID '{message-id goes here}' does not exist'.

Likewise I am getting same error while trying to fetch details about {conversation-id} which I fetched from webhook, which I integrated to receive notifications about message which I will receive from customer.

Also, a point to note is that.. while reading through Graph API documentation for /messages as well as /conversation APIs is says 'An individual message in a Messenger or Instagram Messaging conversation.' and 'A Messenger conversation between a person and a Facebook Page or an Instagram Professional Account.' does this means this Graph APIs is only accessing for data which is shared over facebook page/messages and/or instagram messages.

What I am trying to acheive using Graph API is to get conversation details for whatsapp business API happened between customer and business.

Please help clear my above concerns.

Thanks, Abhishek

I am new to this WhatsApp Business API and interested in reading or getting conversation details between customer and business.

As I was exploring APIs which meta offering us to use, I did not found from here (https://www.postman.com/meta/workspace/whatsapp-business-platform/collection/13382743-84d01ff8-4253-4720-b454-af661f36acc2) any API which is helping me to read any conversation based on conversation-id or any such kind of ids, which happened between customer and business.

Is there any such API using which we can get conversation / message-thread details?

Please correct me if I am checking right APIs which meta is offering us to use, any lead would be appriciated.

Thanks