WhatsApp API- Generate a Permanent Access Token Tutorial

Manish Joshi
4 min readNov 5, 2022

--

Creating a developers account

Make sure You have an active Facebook account.

Step 1: Login and Go to https://developers.facebook.com/

An active Facebook account

Step 2: Click on Get Started on above screen. And create a developers account.

create a developers account

By Clicking on Continue You must agree to https://developers.facebook.com/terms/ and https://developers.facebook.com/devpolicy/

Step 3: Enter a developer’s email which is not associated with a fb account previously.

enter a primary email

Step 4: Enter the code sent on your email.

Enter the code sent on the email

Step 5: Select your role and Complete registration.

Choose which best describes you

Create App

Step 6: Click on Create App button.

Create App

Step 6: Select App type and click on next. I have checked business.

Select App type

Step 8: Provide App basic information.

Add Basic Information

Setup WhatsApp

Step 8: Now , you can have a App Id , Click on Setup button for WhatsApp.

Setup WhatsApp

Step 9: Create or Select a Meta Business Account.

Create a Meta Business Account.

You must read FB terms for Whatsapp business : https://www.whatsapp.com/legal/FB-terms-whatsapp-business

You must read Hosting Terms for Cloud API https://www.facebook.com/legal/Meta-Hosting-Terms-Cloud-API

One Need to create a business account

Step 10: Create a Temporary Access Token.

Temporary Access Token

See in above screen we have Temporary access token which will be valid for 23 hours. A temporary Phone Number ID and WhatsApp Business Account ID , we obviously can add our Custom Phone number , which we will show later on.

Step 11: Getting Started, Click on Add Phone Number.

Add phone number

Step 12: Fill in your business information.

Add Business Information

You’ll receive an email to verify it.

Generate the permanent access token

Step 13: One can add Administrators and developers to the app below.

Permanent Access token
Roles screen

Now Open the developers account of the added user , he must have got a notification to accept from this image.

In the above Roles screen , there is an option to Edit roles in Business Manager.

Step 14: One must have a fb account, in order to be added into the above role enter either fbid or username.

Now Open the developers account of the added user , he must have got a notification to accept from this image.

In the above Roles screen , there is an option to Edit roles in Business Manager.

Business Manager Account

Click on the Edit roles in Business Manager button, it will open the Business Settings Page of the App.

By selecting People one can have Admin access Or Employee Access, with developer role this will be useful in creating permanent token access. The maximum number of admin system user limit.

Step 16: You need to enter a mail id on widely accepted extensions, like .in , .com . It won’t take mail id created on rare domain extensions

invite people

This business has reached maximum number of admin system user limit. The maximum number of admin system user that you could have is 1 . You can use your admin role to generate the permanent access token.

Create System User

Step 16: By Clicking on Add Assets, one can assign Apps to the Particular role.

Add Assets

Assign assets to App

Step17: One Can Generate New Permanent Token by Clicking on the below button.

Generating Access Token

Step18: Select the appropriate business app and select below permissions

√ business_management

√whatsapp_business_messaging

√ whatsapp_business_management

Click on Generate Token Button

Select Appropriate Permissions

Step 19: Copy and Save above token in an appropriate place, as fb doesn’t store it anywhere. Now you have Permanent token and you can send WA API Messages

Save Token at Safer Place

--

--

Manish Joshi
Manish Joshi

Written by Manish Joshi

I am an IT professional with more than 15 years of Experience in IT industry and having a orientation towards mysticism and philosophy.