Articles on: Getting Started

Setup Phone Number using Custom API Credentials

We provide you two options to setup your phone number with the WhatsApp APIs. Either you can set it up using Embedded Signup Flow or by generating your own custom API credentials directly.

In this article, we're going to see how you can do the setup using the 2nd method.

How to Setup Phone Number using Custom WhatsApp Cloud API Credentials?



Before starting, make sure you have created your WANotifier account. You can go through this article for the steps on how to create your account with us. If you have done that already, let's get started!

IMPORTANT - Do not skip any step shown below to avoid facing issues later. Setting up Webhook and adding Payment Method are two common steps that users usually tend to skip. Please do not skip them to complete the full setup.

You can either watch the video below or follow the step-by-step written instructions to continue.



1. Create Meta account and an app for WhatsApp Cloud API



Create a free Meta developer account, if you don’t already have one.
Next, on the Meta for Developers portal, click on the green Create App button to create a new app.
On the next page, it’ll ask Which use case do you want to add to your app?, select the Other option.
On the next page, select the Business option and click on the Next button at the bottom.
On the next page, Add an app name and Add contact email. Then in the Business Account field, select a business account if you already have one. If you don’t have one, keep the No Business Manager account selected option selected. Then click on Create app button.
You will be redirected to your App page where you need to Add products to your app. Scroll to the bottom to find WhatsApp product and click Set up.
On the next WhatsApp Business Platform API screen, you will see the option to select an existing Meta Business Account. Select your account if you already have it, or else select the Create a business account option to create a new one. Then click Continue.
You will be redirected to the Quickstart page that will look something like the following:


2. Add your phone number



From the sidebar go to WhatsApp > API Setup page, scroll down to the bottom of the screen and click on Add phone number button.

A new popup will open to Create a WhatsApp Business profile. Enter WhatsApp Business Profile Display Name that matches your business name, Also select appropriate Category. After filling the details, click Next.
IMPORTANT: Do not enter dummy name in Display Name field like Test Business or any other random text. The name must match your business name.
Next, you’ll need to add your phone number to use it as your WhatsApp phone number. Enter your phone number and select a verification method to verify the number.
NOTE: Once a phone number is setup here it’ll be connected with WhatsApp Cloud API and you will not be able to use it with the mobile app.
Enter the verification code and click Next to finish adding the number.

3. Configure webhooks



From the left sidebar, click on Whatsapp > Configuration link.
Click on the Edit button. That’ll open a popup. In the Callback URL and Verify Token fields, add the values that you see on the WANotifier setup page (below video).
If you've already done the API setup earlier, you can also find these details from Settings > API Configuration page.
After this, under Webhook fields, click on the Manage button. In the popup that opens, click on the Subscribe button in front of all the fields.
Subscribing to all fields is mandatory for full integration with WANotifier.
Click on Done to complete your Webhook setup. And the end the webhooks configuration should look like this:


4. Generate permanent access token



Now let’s create the Permanent Token. Scroll to the top of the page and click on App Dashboard next to the MetaforDevelopers logo. Then right click on Business Settings to open it in a new tab. Keep the current App Dashboard tab open.

On the Business Settings page, in left sidebar, click on System users under Users. Then click on Add to add a new user.
Click on I Accept button if you see non-discrimination policy popup.
Enter a name for your System user name (you can keep it system). Select System user role as Admin and click on Create system user.
Now click on the Add Assets button. Under Select asset type click on Apps, select your app from Select assets column and then enable Full control > Manage App. Then click on Save Changes.

Now click on Generate New Token button. Select your app from the dropdown and select the Token expiration option as Never.
Then from the list of permissions under Available Permissions:  enable the following permissions:
whatsapp_business_messaging (required)
whatsapp_business_management (required)
catalog_management (optional, enable this if you plan to use Product Catalog feature)
business_management (optional, enable this if you plan to use Product Catalog feature)
Then click on the Generate Token button and copy the Access token.

Now that we’ve generated Phone Number ID, WhatsApp Business Account ID and Permanent Access token, paste them on Settings > API page and click on the Save changes button.

5. Add payment method



Now from the left sidebar go to Accounts > WhatsApp Accounts page, select your WhatsApp account from the list and click on the Settings tab.
Then click on the Payment Settings button. On the Payment Settings page, click on Add payment method button.
Select your CountryCurrency and Payment Method and click Next.
Enter your payment details and hit Save. You’ll see a screen like the following after your payment method is added successfully:


6. Change App Mode to Live



Now go back to the App Dashboard tab that you have open from earlier.
On the top you’ll see App Mode. Change it from Development to Live.

You’ll see a prompt on screen to provide additional information like Privacy Policy URL etc.
Go to Settings > Basic page and enter your website’s Privacy Policy URL. Here you can also add other optional details like App Domain, Contact email, Terms of Service URL etc. Once you fill in all details, click on Save changes.
Now again click on the toggle button to change it from Development to Live.

7. Save and validate your credentials



On the WhatsApp > API Setup page, open the dropdown under Step 1: Send and receive messages under the From label and select the phone number you added.
After selecting your phone number, the Phone Number ID and WhatsApp Business Account ID values will get updated below it. Copy those values and paste in the respective fields in form.

Also copy the Permanent Access Token that you generated earlier and paste that in the respective field.

All done! Click on the Save and validate button to complete the setup!



That's it. That's how you can setup your phone number using your own custom WhatsApp Cloud API credentials.

Updated on: 23/01/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!