PeteSE4
PeteSE4

Reputation: 433

Error adding phone number to WhatsApp API

I'm trying to create a simple ChatBot for WhatsApp and have hit a brick wall adding a phone number to the account. I've been Googling and trying various things for the last week and have gotten no further.

I have set up an App in my Facebook Developer account with WhatsApp; In API Setup I've added a new number (paid number that's guaranteed to work with WhatsApp, not one of the freebie ones), verified it by SMS and got an phone ID for that new number. However, when I try and 'generate access token', I get the following error:

WhatsApp error - unsupported post request

If I try to register or verify the number via API, using either the /PHONE_ID/register or /PHONE_ID/request_code endpoints, I get the same error message in the terminal saying the PHONE_ID does not exist, yet if do a check of /BUSINESS_ID/phone_numbers it returns a response with that very same PHONE_ID, eg:

{
   "data": [
      {
         "verified_name": "Business Name",
         "code_verification_status": "VERIFIED",
         "display_phone_number": "+44 XXXX XXXXX",
         "quality_rating": "UNKNOWN",
         "platform_type": "NOT_APPLICABLE",
         "throughput": {
            "level": "NOT_APPLICABLE"
         },
         "webhook_configuration": {
            "application": "https://foo.bar/mywebhook.php"
         },
         "id": "PHONE_ID"
      }
   ],
   "paging": {
      "cursors": {
         "before": "XXXXXX",
         "after": "XXXXX"
      }
   }
}

I have made sure the business itself is verified and has a payment source. The phone number name has been approved. I cannot find any unmissed alerts in WhatsApp manager, and yet the number remains 'pending'. In the API config, the drop-down shows the number, but is unselectable as it's saying it's not registered. Oh my days...

Any help would be much appreciated. I'm tearing my hair out over this one.

Upvotes: 0

Views: 370

Answers (1)

Sanjay K
Sanjay K

Reputation: 1

First of all if you have added the number from developer portal than you the number is registered already, u don't have to make register call or request OTP. You can simply generate a system access token. You will be able to use this token directly to send messages.

Upvotes: 0

Related Questions