Links

Partner API integration

The 360dialog Partner API allows to automate different processes of account management, usage statistics collection and let you know about status changing of your client’s accounts.
The basic principles of interaction with Partner API are the same as for WhatsApp API.

Getting Started

In order to get started with the Partner API you need two things: your 360 Partner Hub login credentials and your Partner ID.

Login Credentials

All requests to the Partner API are secured by a Bearer Token, which can be obtained by providing a username (email) and a password. For this, you can either use a personal user account or set up a system user specifically for the API tasks. Make sure you have this information at hand when starting to work with the Partner API.
For more information on Authorization have a look at the API description and the token endpoint description.

Partner ID

For all endpoints except the /token endpoint you will need to provide your individual Partner ID. The easiest way to find your Partner ID is to log into the 360 Partner Hub on your browser and go to the "WhatsApp Accounts" section. Then check the URL in the address bar of your browser. The Partner ID follows after the /partner/ parameter and can easily be identified by its PA suffix, see the image below.
To understand more about the Partner ID and credentials, see the Architecture and Security doc.

Base URL

The default base URL for the 360 Partner API is https://hub.360dialog.io/api/v2
A Mock Server is available in https://stoplight.io/mocks/360dialog/360dialog-partner-api/24588693

Authorization

Endpoints of the Partner API need to be accessed by providing a Bearer token in the Authorization header.
To retrieve this token, a call to the /token endpoint needs to be made including the username (email) and password of one of your partner users in the request body. You can either use a personal user account or set up a system user specifically for the API tasks. The response from the /token endpoint will include an access_token.
post
https://hub.360dialog.io/api/v2
/token
Request OAuth token for any Partner API request
After token is received, use this access token in your authorization header:
"Authorization": "Bearer <your-access-token>"
Bearer Tokens are authentication tokens specifically designed for use with the Partner API. It cannot be used in combination with the WhatsApp Business API.
For the WhatsApp Business API, the supported authentication method is through the use of API Keys - Adding D360-API-KEY in the header with your Client's unique API Key as a value will grant access to WhatsApp Business API messaging. See how to retrieve an API key here.

Setting up your Partner API Webhook URL

To perform several actions and receive webhook events for notifications, you will need to set your Webhook URL, which is an API endpoint.
post
https://hub.360dialog.io/api/v2
/partners/{partner_id}/webhook_url
Set Partner Hub Webhook URL
After the Webhook URL is set, you will start receiving events about the accounts registered under your Partner Hub. See all events available today here.

Check your Partner API Webhook URL

You can check the Webhook URL used with this endpoint.
get
https://hub.360dialog.io/api/v2
/partners/{partner_id}/webhook_url
Set Partner Hub Webhook URL

Check Partner Hub information

You can use GET requests to check information regarding your 360 Partner Hub.
get
https://hub.360dialog.io/api/v2
/partners/{partner_id}
Get 360dialog Partner Hub information

Check Integration settings in the 360dialog Partner Hub

Accessing Webhook and Redirect URL Configurations
The Integration tab in your Partner Account displays your Webhook URL and Redirect URL configurations. It enables you to:
  1. 1.
    View Defined URLs: Easily review the URLs that have been set for your Integrated Onboarding.
  2. 2.
    Edit and Test URLs: Gain flexibility by editing and testing these URLs to ensure they align with your requirements from the 360dialog Hub interface.
    • Please be aware that whenever you make edits, the previous URL will be overwritten with the new one.
    • Testing the webhook triggers a Hub API endpoint. If an error occurs, it is usually because the configured webhook does not provide a response with a 2xx status code. In these situations, information regarding the encountered error is communicated through a notification.
Webhook URLs do not support "_"(underscore) or ":xxxx"(port)in (sub)domain names. Invalid webhook URL: https://your_webhook.example.com Valid webhook URL: https://yourwebhook.example.com Invalid webhook URL:https://subdomain.your_webhook.example.com:3000 Valid webhook URL: https://subdomain.yourwebhook.example.com
Default Hosting Platform Type
Within the same tab, you can verify your Default Hosting Platform Type. This setting confirms that all numbers, whether they're newly created or migrated, are automatically assigned to the designated default hosting type.