Posts tagged with whatsapp-cloud-api

I am getting this error when click on Send Message In API setup section (Sending of message failed. There was a problem with the access token or permissions you are using for the API call) [First Issue]

Its working perfect few hours ago facing problem after creating a new Facebook business profile in same Facebook profile and verified it and other thing i do is add a new number in meta business suite, and in my other business profile i unable to add phone number for onboarding.

getting this error in second profile

There was a problem registering your phone number This page is not available right now. Please try reloading in a few minutes. (Second Issue)

is there anybody who face this problem or have any solution for this.

WhatsApp Business Cloud API: Message Accepted but Not Delivered

I’m using the WhatsApp Business Cloud API to send a template message. The API request returns a status of "accepted," but the recipient is not receiving the message.

Request Details:

  • Request URL:

    POST https://graph.facebook.com/v20.0/<phone_number_id>/messages 
  • Request Body:

    {     "messaging_product": "whatsapp",     "recipient_type": "individual",     "to": "<Mobile Number>",     "type": "template",     "template": {         "name": "booking_details",         "language": {             "code": "en"         },         "components": [             {                 "type": "body",                 "parameters": [                     {"type": "text", "text": "chennai"},                     {"type": "text", "text": "salem"},                     {"type": "text", "text": "tn15505"},                     {"type": "text", "text": "star"},                     {"type": "text", "text": "23.02.2024"},                     {"type": "text", "text": "koyambedu"},                     {"type": "text", "text": "bus stand"},                     {"type": "text", "text": "10:00 a.m."},                     {"type": "text", "text": "₹5055"},                     {"type": "text", "text": "L1/S,L2/S"}                 ]             },             {                 "type": "button",                 "sub_type": "quick_reply",                 "index": "0",                 "parameters": [                     {                         "type": "payload",                         "payload": "PAYNOW_PAYLOAD"                     }                 ]             },             {                 "type": "button",                 "sub_type": "quick_reply",                 "index": "1",                 "parameters": [                     {                         "type": "payload",                         "payload": "CHANGE_DETAILS_PAYLOAD"                     }                 ]             }         ]     } } 

Response:

{     "messaging_product": "whatsapp",     "contacts": [         {             "input": "receiver",             "wa_id": "id"         }     ],     "messages": [         {             "id": "wamid.HBgMOTE4MDU2MTg1NjI5FQIAERgSMUQwQzU3MjVENDBBMEQ5NTk5AA==",             "message_status": "accepted"         }     ] } 

What I've Tried:

  • Verified that the template is approved and matches the template ID.
  • Confirmed the recipient's phone number is registered with WhatsApp.
  • Ensured the phone_number_id and access token are correct.
  • Checked that the recipient has opted in to receive messages.
  • Verified there's no issue with my WhatsApp Business Account (no low-quality rating or rate limiting).

Despite the message being accepted, it’s not delivered to the recipient. What could be the reasons for this, and how can I troubleshoot or resolve this issue?

I am using the WhatsApp Cloud API to create and send forms using the Flow feature. The forms are successfully created and are accessible by other users without any issues. However, when I try to open the form on my own WhatsApp Business App, it gets stuck on the loading screen and never fully loads. Even simple test messages like "Hello World" fail to display.

Here are the steps I've taken:

  1. Created a form using JSON.
  2. Verified that the JSON is correctly formatted.
  3. Confirmed that the form works on other users' devices.
  4. Updated my WhatsApp Business App to the latest version.
  5. I have a good internet connection

Example JSON:

{     "version": "3.1",     "screens": [         {             "id": "WELCOME_SCREEN",             "layout": {                 "type": "SingleColumnLayout",                 "children": [                     {                         "type": "TextHeading",                         "text": "Hello World"                     },                     {                         "type": "TextBody",                         "text": "Let's start building things!"                     },                     {                         "type": "Footer",                         "label": "Complete",                         "on-click-action": {                             "name": "complete",                             "payload": {}                         }                     }                 ]             },             "title": "Welcome",             "terminal": true,             "success": true,             "data": {}         }     ] } 

Log Information:

[2024-08-07 16:38:01] local.DEBUG: Sending message to WhatsApp API  [{"stdClass":{"type":"interactive","interactive":{"type":"flow","body":{"text":"Hello word template"},"action":{"name":"flow","parameters":{"mode":"draft","flow_message_version":"3","flow_token":"aiqvYS","flow_id":"11655894848158","flow_cta":"Me Test","flow_action":"navigate","flow_action_payload":{"screen":"WELCOME_SCREEN"}}},"header":{"type":"text","text":"Welcome to the BotController"}},"to":"2637123456","messaging_product":"whatsapp","recipient_type":"individual"}}] 

Has anyone encountered this issue before or have any suggestions on how to resolve it? Any insights or solutions would be greatly appreciated.

Additional Info:

  • My device is running the latest version of the WhatsApp Business App.
  • Basic flow forms also fail to load on my device.

Thank you in advance!

I am trying to send an audio message using the Whatsapp Cloud-api, but I am now dealing with a problem that seems to have no documentation available.

Overview of the issue

  • I send an audio file (mp3) to whatsapp as described here.
  • I verify that the file was sent correctly by downloading the file using the media download endpoint.
  • I then try to send the audio as a message using the endpoint specified here.
  • I receive a webhook request with information about my message, this request informs me that the message failed because of "Media file scrutiny for the file failed with mediaEngineStatus: 0" with the code "131053".

Different things I tried

I tried searching the error code in the documentation, it can be found in this page, the page recommends me to verify the type of the audio files I'm using so I used the file --mime-type command in linux an confirmed that the mp3 is actually an mp3.


I tried using the .ogg format instead of mp3 since audio's on whatsapp by default are of type .ogg. The way I did that was that I sent an audio to myself, download the audio, and tried using it instead. The webhook returned the same thing. I also verified the type of the .ogg file using file --mime-type


I tried sending a hello world template message to myself first, responding that message, and then sending the audio, I tried this step since in the whatsapp documentation it is explained that audio messages can only be sent after someone answers the template message. The webhook still returned the same thing.


I stopped using my own code to do this and started using the Insomnia rest client to do the requests to the whatsapp API to make sure that my code was not a factor in this error, I then repeated all the tests explained above using only the Insomnia, I still had my code receive the webhook results since Insomnia is not capable of doing that, but the results were still the same.


I then decided to use ffmpeg to convert my .mp3 to .mp3 and my .ogg to .ogg in an attempt at guaranteeing the type of the files I was sending despite the action seeming to be redundant. I then repeated all tests using both my code and Insomnia but there was no luck and the results were still the same.

A few key points that I already checked

  • I am using multipart/mime both in Insomnia and my code to send the file and the part about uploading the file works well in both situations
  • The audio does not get corrupted after being sent to the whatsapp API since it can be dowloaded and i can listen to it after.

Why no code in the question

I decided to not add any of my code in this question because I only want an explanation on why this is happening on Insomnia, since it is a standard rest client and it should work as far as I can tell, after I manage to make it work in insomnia I will make the requests work in the same way using my code. This seems to me to be an easier task then trying to change the way my code is doing it from the start.

Bellow I have the requests i sent using insomnia (with private info removed for the print screen)

I would like to call for suggestions regarding a challenge I've been trying to solve recently involving Meta API & Webhooks. I assume this particular setting has not been addressed here before.

As one may know, to configure receiving requests from WhatsApp, Facebook, and Instagram for a Meta app you need setting up a webhook for each in the respective parts of Meta dev dashboard. This involves allowing webhooks required app-level subscriptions/permissions and providing an endpoint that you confirm by returning a verify token on a GET request to ensure it's ok to send you requests there.

In my case, I would like other people to use the app as well, so I added oath2 to get necessary permissions for user business pages on Wa, Fb or Instagram, which works well.

After that, with necessary access, you can add your or someone's page to a pre-configured webhook, so it starts accepting requests. This action can be done through a dashboard in the menu that looks similar to this depending on the platform.

On the other hand, this can be done with sending a request, specifying webhook subscription fields yourself (such as messages on the picture above).

POST /v20.0/{app-id}/subscriptions HTTP/1.1

However, this feature is only available for Facebook pages and in the request-dedicated article we can see it mentioned. Any other webhook-related requests actually allowed for WhatsApp and Instagram are only for adding a webhook to an app (the very first step described here).

Limitations:

Webhooks for Instagram is not supported. Instagram webhooks must be configured using the App Dashboard. Webhooks for WhatsApp is not supported. WhatsApp webhooks must be configured using the App Dashboard. https://developers.facebook.com/docs/graph-api/reference/v20.0/app/subscriptions

And given that, one needs to do it through dev dashboard UI which is not an acceptable solution in my case.

Therefore, I can really use some insights on how can this be solved directly or through some witty alternative to receive messages from all three platforms and being able to programmatically allow webhook page requests.

Additionally, I have been considering raising the issue with Meta directly, so it can be adjusted and would love to hear thoughts on potentially doing this.

P.S.

For those deeply interested in the issue, I found some sort of similar issue on the meta dev forum https://developers.facebook.com/community/threads/799110895741478/