Posts tagged with whatsapp-cloud-api

Through this facebook developers article and this supporting article I understand that there are certain limitations on sending marketing templates. Everytime a user replies in an open marketing conversation (i.e. If a user responds to a marketing template) we are allowed to send one more marketing template.

In my case, I am sending user a template lets say template_A, when he interacts with that template he should get a text message and another template, template_B. Which, according to the articles, is possible. But the user is only getting the text message and not template_B, with console stating that

131049 This message was not delivered to maintain healthy ecosystem engagement.

Also, this is not happening with all the numbers. Some of them can use the app properly. Am I reading something wrong here? Are there any kind of other limitations that can be causing this issue?

I'm in process of registering phone number to be used with Whatsapp API, when I try to generate access token for my phone number, I'm greeted with this alert.

There was a problem registering (my phone number). Unsupported post request. Object with ID '(phone_number_id)' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

There also this message that tells me the phone number needs to be registered.

When I attempt to follow the link, it brings me to this page, it has instruction to follow and "certificate".

The these instruction link lead to documentation on how to register the phone number, however the top of documentation clearly state that this instruction no longer valid as of now because it is using on premise API. So I tried to find the one valid for cloud API, I found this documentation → https://developers.facebook.com/docs/whatsapp/cloud-api/reference/registration/

The documentation offers a way to register the phone number through API, below is the snippets I copied from the documentation.

curl 'https://graph.facebook.com/v21.0/106540352242922/register ' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer EAAJB...' \ -d ' {   "messaging_product": "whatsapp",   "pin": "212834" } 

The question is how do I get phone number ID if my phone number is not "registered" to begin with ? I tried to retrieve the phone number ID by following the link here → https://developers.facebook.com/docs/whatsapp/business-management-api/manage-phone-numbers#get-all-phone-numbers, but it only list the test phone number, my phone number does not appear.

{   "data": [     {       "verified_name": "Test Number",       "code_verification_status": "NOT_VERIFIED",       "display_phone_number": "+1 555-131-8955",       "quality_rating": "GREEN",       "platform_type": "CLOUD_API",       "throughput": {         "level": "STANDARD"       },       "id": "375420581369195"     }   ],   "paging": {     "cursors": {       "before": "xxxx",       "after": "xxxx"     }   } } 

I'm encountering an issue with the WhatsApp Business API where template messages are not being received, despite getting a successful API response.

Issue: When sending an approved template message via the WhatsApp Business API, I receive a 200 success response, but the message is not delivered to the recipient's WhatsApp. However, normal text messages are received successfully.

Environment:

  • Using WhatsApp Business API

  • Sending messages via Postman

  • Have necessary token and phone number ID

  • Phone number registered and connected in Meta Business Manager

  • Message template approved

Template Message Payload:

{   "messaging_product": "whatsapp",   "to": "917xxxxxxxx",   "type": "template",   "template": {     "name": "billz_order",     "language": {       "code": "en_US"     },     "components": [       {         "type": "body",         "parameters": [           {             "type": "text",             "text": "₹500.00"           },           {             "type": "date_time",             "date_time": {               "fallback_value": "October 25, 2023"             }           }         ]       }     ]   } } 

API Response for Template Message:

{ "messaging_product": "whatsapp", "contacts": [ { "input": "91xxxxxxxxx", "wa_id": "917339249430" } ], "messages": [ { "id": "wamid.HBgMOTE3MzM5MjQ5NDMwFQIAERgSMkRERkFBRTRFRjNEMjA2RkM5AA==", "message_status": "accepted" } ] }

Test Message Payload (which works):

{   "messaging_product": "whatsapp",   "recipient_type": "individual",   "to": "911234567890",   "type": "text",   "text": {     "body": "This is a test message. Hello from WhatsApp API!"   } } 

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?

  1. Verified that the template is approved in the Meta Business Manager

  2. Confirmed that the phone number is correctly registered and connected

  3. Checked that the token and phone number ID are correct

  4. Ensured that the template payload matches the approved template structure


The "App Review" process requires registering your phone number using a verified certificate (see screenshot).

1. Obtain the phone certificate

I obtained the certificate through this link: WhatsApp Manager > Phone numbers
https://business.facebook.com/latest/whatsapp_manager/phone_numbers/?business_id=1234&asset_id=1224&nav_ref=whatsapp_manager&tab=phone-numbers&psp_linking_success=0&is_from_mbs=1

2. WhatsApp requires to register the phone using an /v1/account endpoint

The WhatsApp system requests that you send a POST request to the /v1/account endpoint, as described in the WhatsApp Business Platform > On-Premises API > Reference
https://developers.facebook.com/docs/whatsapp/on-premises/reference/account/

3. Attempt to call the /v1/account endpoint

I attempted to call the endpoint using this URL:
https://graph.facebook.com/v1/account
The body of the request follows the format defined in the API documentation 2.

Here is the body of the POST request:

POST /v1/account {     "cc": "COUNTRY_CODE",     "phone_number": "PHONE_NUMBER_WITHOUT_COUNTRY_CODE",     "method": "sms" or "voice",     "cert": "VERIFIED_NAME_CERT_IN_BASE64",     "pin": "EXISTING_6_DIGIT_PIN"  # required if two-step verification is enabled } 

4. Error message got after calling /v1/account endpoint

I get the follow error

{     "error": {         "message": "Unknown path components: /account",         "type": "OAuthException",         "code": 2500,         "fbtrace_id": "1234"     } } 

Goal: I want to provide WhatsApp messaging feature within my android app for my customers to send messages to their customers, and without my customers intervention in terms of any accounts setup/embedded signups for them. Because my customers won't use this feature if they need to invlove in the setup process that Meta docs are suggesting as a solution or tech provider. So I want to use my own setup and WABA account so that my customers can use this feature right way.

My Setup:

  1. Meta developer account is created.

  2. Meta business manager is created.

  3. Meta app is created and linked to business portfolio.

  4. My business verification is successfully completed.

  5. WABA Account is created and my new business phone number is added and Webhooks setup also done.

  6. Access Verification is not done as I am not going to deal or create my customers WABA accounts.

  7. App Review submission is failed as I didn't provide FB Login button and now I think I understood why FB login is needed and now I don't want my customers fb login intervention as it is going to come to the concept of dealing customers WABA accounts in the end.

  8. Added Phone number is in unavailable status, its registration is failing because of on premises api expiration and struggling to do it with Cloud API endpoints like /wabaId/phone_numbers, /request_code, /verify_code etc and now I completely got stuck and confused on how to register business phone number with certificate code and without issues.

Test implementation in the app:

  1. Multiple messaging templates are created and available to use.
  2. We are able to send whatsapp messages using templates created to the mobile numbers added in the test list in development mode.

Problems/Concerns/Queries To achive my goal mentioned above:

  1. Is my goal achievable?
  2. How to register added business phone number using certificate code as per latest docs/changes?
  3. Does it require access verification to register business phone number?

Please help me with my goal and what else I need to do or am I missing anything?

Currently added business phone number is in unavailable status and need to get it to active status.

I am assuming that I don't need to go through access verification and app review process as I'm not going to deal customers individual setup/waba accounts.

I am expecting to use my business phone number id with permanent access token to make graph API /messages calls and send messages to customers of my customers. This will be triggered by my customers through my android app.