Posts under category Meta & Facebook
How to get the URL of an image in WhatsApp Business Cloud API, while we send an image through WhatsApp
While working on WhatsApp Business Cloud API, I have to send an Image through WhatsApp. When I send that image I am getting a response as a sha256 base64 string and an imageId. I want to retrieve back that image using these credentials. I'm getting a URL when I make a get request with that image id. That URL is actually broken/invalid and I'm not getting the image back.
Response of the request is given below :
"messages": [ { "from": "918******6", "id": "wamid.HBgMOT*********EA", "timestamp": "1655978686", "type": "image", "image": { "mime_type": "image/jpeg", "sha256": "ian**********jM4k=", "id": "4**********7" } } ]
Using a same phone no in WhatsApp business cloud Api and in business app [closed]
I am integrating whatsapp graph api/whatsapp cloud api in my webapplication/crm. where I need to send text message or document to the customers and return response from the customers. which will be actioned from my customized crm. and i also want to access whatsapp business app with the same phone no which i am actually using now. So is it possible to access the same for both situation with a single phone No.
sending message from Facebook whatsapp api to my number
I am sending message from Facebook whatsapp api to my number for testing. Message is sent from php but not recieved on mobile. Did I must register business on facebook?
{"messaging_product":"whatsapp","contacts":[{"input":"923040165804","wa_id":"923040165804"}],"messages":[{"id":"wamid.HBgMOTIzMDQwMTY1ODA0FQIAERgSOEM3RDJDRDMyMkFENkIzMTgyAA=="}]}
this php code that I am using.
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://graph.facebook.com/v13.0/********/messages/', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>json_encode(array("to"=> $number, "messaging_product" => 'whatsapp', "recipient_type" => 'individual',"type"=>"text", 'text'=> array('body'=>'hello_wo332233rld','preview_url'=>'false'))), CURLOPT_HTTPHEADER => array( 'Authorization: Bearer '.$chatApiToken, 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
WhatsApp Business API not sending /message endpoint or test messages to phone
I've setup a WhatsApp Business to test their new WhatsApp API for sending messages. I've followed the getting started guide, but I'm running into an issue when trying to send a test message to my phone.
I tested sending messages using the test message call in the business settings as shown in the guide and I've created my own /messages
call in Postman using a permanent token. Both calls return a 200 status, but neither of them actually sends a message to my phone.
To double check my setup, I added a colleagues phone to the setup and he receives the messages and can interact with my webhook via WhatsApp just fine.
Some posts on Stackoverflow mention having to send a message to the test number first, but I was unable to get this to work and my colleague didn't have to do this.
Is there some kind of setting or issue that could explain why I'm not receiving the messages? I've even tried re-installing WhatsApp and setting up my phonenumber again, but that didn't change anything either.
Updates:
I tried validating my phonenumber via the /contacts
endpoint, but it keeps returning an auth error. Updating my token to include all Whatsapp permissions did not change this, whatsapp_business_api_data
isn't an option to include.
{ "error": { "message": "(#100) The parameter whatsapp_business_api_data is required.", "type": "OAuthException", "code": 100, "fbtrace_id": "" } }
I noticed that my webhook included a status object in change.value.statuses.[0]
this mentioned the following:
{ status: 'failed', errors: [{ code: 131000, title: 'Failure due to an internal error. Please retry.' }]}
Next I created a new app and added the Whatsapp integration, I added and validated my phonenumber via a text and tried to send a test messsage. This also doesn't start a conversation nor does it give me any feedback. If I try to add my phonenumber again, by adding it as another number, I cant and get the error Reason: VERIFIED