Partner API
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.
Partner ID
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.
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.
Base URL
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.
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
.
Request OAuth token for any Partner API request
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!" }'
Request Body
Name | Type | Description |
---|---|---|
username* | string | Example: user@example.com |
password* | string | Example: 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.
Partner Hub Webhook URL
A Webhook URL is required for you to receive webhook events about account signup and statuses..
Set Partner Hub Webhook URL
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" }'
Path Parameters
Name | Type | Description |
---|---|---|
partner_id* | string | Your Partner Hub ID |
Request Body
Name | Type | Description |
---|---|---|
webhook_url* | string | The Webhook URL you want to set |
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 Partner Hub Webhook URL
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'
Path Parameters
Name | Type | Description |
---|---|---|
partner_id* | string | Your Partner Hub ID |
Partner Hub Redirect URL
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.
Set Redirect URL for 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" }'
Path Parameters
Name | Type | Description |
---|---|---|
partner_id* | string | Your Partner Hub ID |
Request Body
Name | Type | Description |
---|---|---|
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 Hub Information
Use the GET
request to check information regarding your 360dialog Partner Hub.
Get Partner Hub information
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'
Path Parameters
Name | Type | Description |
---|---|---|
partner_id* | string |
Last updated