Partner API
Last updated
The Partner API allows you to interact with our platform programatically.
This allows Partners to build a frictionless user journey for clients and automate processes.
In order to get started with the Partner API you need two things: your Partner ID and your Partner Hub long credentials.
The Partner ID is an unique ID that will be used for most API actions.
The easiest way to find your Partner ID is to log into the 360dialog Partner Hub on your browser and go to the "Partner Integration" section.
You can alternatively 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 documentation.
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.
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 default base URL for the 360dialog Partner API is https://hub.360dialog.io/api/v2
The basic principles of interaction with Partner API are the same as for Messaging API.
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 example
curl --request POST
--url https://hub.360dialog.io/api/v2/token
--header 'Authorization: '
--header 'Content-Type: application/json'
--data '{ "username": "user@example.com", "password": "123StrongPass4Me!" }'
After token is received, use this access token in your authorization header:
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.
A Webhook URL is required for you to receive webhook events about account signup and statuses..
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/webhook_url
Request example
curl --request POST
--url https://hub.360dialog.io/api/v2/partners/partner_id/webhook_url
--header 'Authorization: '
--header 'Content-Type: application/json'
--data '{ "webhook_url": "https://example.com/webhook" }'
After the Webhook URL is set, you will start receiving events about the accounts registered under your Partner Hub. See all events available today in the Partner API here.
You can check the Webhook URL configured with the endpoint below.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/webhook_url
Request example
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/partner_id/webhook_url
--header 'Authorization: '
--header 'Content-Type: application/json'
The Redirect URL indicates where a client should be redirected to after they have completed the Integrated Onboarding flow. Having a Redirect URL set is required to use Integrated Onboarding.
You can also add a Redirect URL in your Partner Hub.
PATCH
https://hub.360dialog.io/api/v2/partners/{partner_id}
Request example
curl --request PATCH
--url https://hub.360dialog.io/api/v2/partners/partner_id
--header 'Authorization: '
--header 'Content-Type: application/json'
--data '{ "webhook_url": "string", "partner_redirect_url": "string" }'
Use the GET
request to check information regarding your 360dialog Partner Hub.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}
Request example
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/partner_id
--header 'Authorization: '
--header 'Content-Type: application/json'
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
username*
string
Example: user@example.com
password*
string
Example: 123StrongPass4Me!
partner_id*
string
Your Partner Hub ID
webhook_url*
string
The Webhook URL you want to set
partner_id*
string
Your Partner Hub ID
partner_id*
string
Your Partner Hub ID
webhook_url*
string
Your Webhook URL which needs to be previously created - see how in the Partner API integration document
partner_redirect_url*
string
The Redirect URL you will use
partner_id*
string