whatsapp-cloud-apifacebook-appreview

WhatsApp app-review : call to /v1/account generates Unknown path components: /account


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

enter image description here

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"
    }
}

enter image description here


Solution

  • The /v1/account endpoint is not working because this is the endpoint to use when you use the on-premise WhatsApp server

    I guess that the correct endpoint is {PHONE_NUMBER_ID}/register

    https://developers.facebook.com/docs/whatsapp/cloud-api/reference/registration/

    PS: WhatsApp documentation leads mistakenly to the /v1/account :-(