#WhatsApp Cloud API

Number of APIs: 34

WhatsApp Cloud API , hosted by Meta, is the official WhatsApp Business Platform API used for business messaging. This collection contains common queries, sample responses, and links to supporting documentation that can help you quickly get started with the API.

Requirements

To use the API and this collection you must have a Meta business portfolio, a WhatsApp Business Account, and a business phone number. If you complete the steps in the Cloud API Get Started guide, these assets will be created for you.

Environment

This collection has a corresponding WhatsApp Cloud API Qodex [environment] which you must select when using the collection. Set current values for the variables defined in this environment if you wish to use the collection to perform queries.

You can find most of these values in the WhatsApp Manager or the WhatsApp > Getting Started panel in the app dashboard . However, if you have an access token and your business portfolio ID, you can use queries in the collection to get the remaining values.

Access tokens

The API supports both user and system user access tokens. You can get a user access token by loading your app in the app dashboard and navigating to the WhatsApp > Getting Started panel. Alternatively you can use the Graph API Explorer to generate one.

Since user access tokens expire after 24 hours, you'll likely want to generate a system user access token, which lasts up to 60 days (or permanently, if you wish). See Access Tokens to learn how to create a system user and system user access token.

Once you have your token, save it as a current value in the environment.

Business portfolio ID

You can get your business portfolio ID by signing into the Meta Business Suite . The ID appears in the URL as the business_id query string parameter value. Once you save this as a current value in the environment, go to the WhatsApp Business Account (WABA) folder and run the Get all owned WABAs query. This will return your WABA ID, which you can save to your environment and then use to determine your business phone number ID.

Permissions

The API only relies on two permissions:

  • whatsapp business management
  • whatsapp business messaging

Note that if you get a user access token from the app dashboard, your app will automatically be granted these permissions (by you, on your behalf), so you can use the token to test right away.

Queries that target your business portfolio require the business_management permission, which you may also need based on your business use case. Most developers do not need this permission, however, as accessing your business portfolio is uncommon, and the Meta Business Suite provides nearly all of this functionality anyway.

Access token debugger

You can paste any token you generate into the access token debugger to see what type of token it is and what permission you have granted to your app.

Pagination

Endpoints that return lists/collections may paginate results (you'll see previous and next properties in the response). Use the URLs from these properties to get the previous or next set of results. Note that if you click one of these links in Qodex, it will open a new query in a new tab which you must save before running (otherwise it can't read your environment variables), so you may wish to cut and paste the URL and run the query in the same tab in which it was returned.

  1. Get Started for BSPs - Step 3: Subscribe to your WABA POST https://graph.facebook.com/{{Version}}/{{WABA-ID}}/subscribed_apps

  2. Get Started for BSPs - Step 4: Get Phone Number ID GET https://graph.facebook.com/{{Version}}/{{WABA-ID}}/phone_numbers

  3. API Reference-Business Profiles - Get Business Profile GET https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/whatsapp_business_profile

  4. Get Started for BSPs - Step 5: Register Phone Number POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/register

  5. Get Started for BSPs - Step 7: Send a Test Message POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/messages

  6. API Reference-Account Migration - Migrate Account POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/register

  7. API Reference-Business Compliance - Get India-based business compliance info GET https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/business_compliance_info

  8. API Reference-Business Compliance - Add India-based business compliance info POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/business_compliance_info

  9. API Reference-Business Profiles - Update Business Profile POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/whatsapp_business_profile

  10. API Reference-Registration - Deregister Phone POST https://graph.facebook.com/{{Version}}/{{Phone-Number-ID}}/deregister