Using the Partner API to manage Clients and Channels
After your Partner API integration is completed, you can use it to manage Clients and Channels.
API Reference
Get Clients
To see the 360dialog Client Hub accounts associated to your Partner Hub, use the Get Clients endpoint.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/clients
Returns all Clients associated with a specific Partner account.
Request example
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients
--header 'Authorization: '
--header 'Content-Type: application/json'
Path Parameters
partner_id*
string
Your Partner Hub ID
Query Parameters
filters
string
A JSON object of params and their expected values
limit
string
Objects limit to return in the response
offset
string
Show the results starting from an offset
sort
string
Use minus -
symbol for descending sorting
Headers
Content-Type
String
application/json
See Filter Options.
Get Client Balance
The WhatsApp Conversations usage is always related to the 360dialog Client Hub (client_id), regardless of the number of channels.
You can retrieve a detailed usage of a channel through the 360dialog Partner API using this endpoint.
GET
https://hub.360dialog.io/api/v2/partners/{{partner_id}}/clients/{{client_id}}/info/balance
Returns the usage and balance associated with a specific Client.
Rate limit: 5 requests per 30 seconds.
Request example
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/info/balance
--header 'Authorization: '
--header 'Content-Type: application/json'
Path Parameters
client_id*
string
ID of the client
partner_id*
string
ID of the partner
Query Parameters
end_date
UNIX Timestamp
The end date in UNIX Timestamp (UTC). Returned data will be equal to or older than the specified date.
Example: 1672531200
start_date
UNIX Timestamp
The start date in UNIX Timestamp (UTC). Returned data will be equal to or newer than the specified date.
Example: 1672531200
granularity
string
The granularity by which you would like to retrieve the analytics.
Supported Options:
DAY
, MONTH
Defaults with MONTH
if no value is provided in the request.
The balance
field is only relevant for clients who are registered with direct payment. When a client is partner-paid, the balance
field will return 0
.
usage
: The array "usage" provides a breakdown of the channel's usage in different categories. These categories may include authentication, marketing, service, utility. Each category within the array includes details such as paid quantity
, price
, and quantity
.
This allows you to analyze the usage patterns and associated costs for different aspects of the channel's messaging services.
See Filter Options.
Get All Channels
You can retrieve detailed accounts statuses through the 360dialog Partner API. This can happen with the get partner's channels endpoint.
GET
https://hub.360dialog.io/api/v2/partners/{{partner_id}}/channels
Returns all channels associated with a specific Partner ID. You can get a channel's Hosting platform type from this request.
Request example
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/partner_id/channels
--header 'Authorization: '
--header 'Content-Type: application/json'
Path Parameters
partner_id*
string
Your Partner Hub ID
Query Parameters
limit
string
Objects limit to return in the response
offset
string
Show the results starting from an offset
sort
string
Use minus -
symbol for descending sorting
See Filter Options.
Get Numbers/Channels you have permission to manage
You can check which channels/numbers under a Client's account you have permission to manage (generate API Key) by calling this endpoint.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/shared_client_numbers
Returns all numbers/channels that you have permission to manage.
When you have permission to manage a number, you can create new API Keys for it. See how you can request permission of new and existing clients here.
Request Example:
curl --request GET
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id/shared_client_numbers
--header 'Accept: application/json'
--header 'Authorization: Bearer 123'
Path Parameters
partner_id*
string
Your Partner ID
client_id*
string
Your Client ID
See Filter Options.
Generate API key for specific channel
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/channels/{channel_id}/api_keys
Request example
curl --request POST
--url https://hub.360dialog.io/api/v2/partners/partner_id/channels/channel_id/api_keys
--header 'Authorization: '
--header 'Content-Type: application/json'
Path Parameters
channel_id*
String
ID of the Channel you want to create the API key for
partner_id
String
Your Partner ID
See Partner Permissions.
Edit maximum number of Channels
The maximum number of channels allowed per 360dialog Client Hub is 10. You can increase or decrease this number with the Max Channel endpoint.
PATCH
https://hub.360dialog.io/api/v2/partners/{{partner_id}}/clients/{{client_id}}
Edits the max number of channels that a specific client can have.
The maximum number of channels permitted per Client is 10 by default. This can be increased or decreased by calling this endpoint and setting the max_channels property in the payload.
Request example
curl --request PATCH
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id
--header 'Authorization: '
--header 'Content-Type: application/json'
--data '{ "partner_payload": "", "max_channels": 42 }'
Path Parameters
client_id*
string
Client ID
partner_id*
string
Partner ID
Request Body
partner_payload*
string
Can be requested with the Get list of clients associated to your Partner Hub endpoint
max_channels
integer
How many channels do you want this Client Hub to be able to create
Cancel Subscription for a specific Number/Channel
Besides the button "Cancel payment on behalf of the client" in the Partner Hub, you can use the endpoint below to set cancellation request on a channel.
Once requested, we will stop the subscription charges and allow the client to pay us directly if they wish to. Your client will receive an automated email notification informing about your action. The cancellation rules explained in the Cancellation document will still apply.
POST
https://hub.360dialog.io/api/v2/partners/{{partner_id}}/clients/{{client_id}}/channels/{{channel_id}}/control/cancellation_request
Cancels the subscription for a channel
Example Request
curl --request POST
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id/channels/channel_id/control/cancellation_request
--header 'Accept: application/json'
--header 'Authorization: '
--header 'Content-Type: application/json'
Path Parameters
channel_id*
string
client_id*
String
parter_id*
String
Partner Payment: Allow Clients to Add Phone Numbers
This endpoint helps Partners with Partner Payment settings to gain control over the process of their clients adding or porting numbers through the Client Hub, ensuring that all numbers that their clients add are attached to their own software/product and billing system.
The default value is ON
. Once turned OFF
, clients won't be able to see the "Add Number" button in the 360dialog Client Hub. You can either toggle it in the 360dialog Hub or patch the configuration in the Partner API endpoint.
Keep in mind that this tool's functionality is limited to managing number additions exclusively within the Client Hub and does not extend to the Integrated Onboarding process, nor provide advanced security features to ensure protection against fraudulent activities.
PATCH
https://hub.360dialog.io/api/v2/partners/{partner_id}
If you have Partner Payment settings, you can control if a client can add new phone numbers to their account with this request.
Example request
curl --request PATCH
--url https://hub.360dialog.io/api/v2/partners/partner_id
--header 'Accept: application/json'
--header 'Authorization: '
--header 'Content-Type: application/json'
--data '{ "webhook_url": "string", "partner_redirect_url": "string", "allow_client_to_add_phone_no": true }'
Path Parameters
partner-id*
String
Request Body
allow_client_to_add_phone_no*
boleean
default: true
partner_redirect_url*
string
webhook_url*
string
Cloud API Local Storage
With such settings enabled, Cloud API uses a localized storage in the specified country for persisting message content, instead of using its default storage based in the US. Alternatively, by disabling Local Storage, Cloud API reverts to its default storage based in the US.
If you wish to change the local storage of a WABA, you can use the Partner API. Note that you will need to receive a pin code in the phone number to confirm the change.
Enable Local Storage
POST
/https://hub.360dialog.io/api/v2 /partners/{partner_id}/clients/{client_id}/channels/{channel_id}/control/enable_local_storage
Request Example:
curl --request POST
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id/channels/channel_id/control/enable_local_storage
--header 'Accept: application/json'
--header 'Authorization: Bearer 123'
--header 'Content-Type: application/json'
--data '{ "data_localization_region": "DE" }'
Path Parameters
channel_id*
String
The ID of the channel.
Example: exampleCH
client_id*
String
The ID of the client.
Example: exampleCL
partner_id*
String
The ID of the partner.
Example: examplePA
Request Body
data_localization_region*
string
Australia, value: AU
Indonesia, value: ID
South Africa, value: ZA
India, value: IN
Canada, value: CA
Japan, value: JP
Singapore, value: SG
South Korea, value: KR
Germany, value: DE
Switzerland, value: CH
United Kingdom, value: GB
Brazil, value: BR
Bahrain, value: BH
Disable Local Storage
POST
https://hub.360dialog.io/api/v2 /partners/{partner_id}/clients/{client_id}/channels/{channel_id}/control/disable_local_storage
Request Example:
curl --request POST
--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id/channels/channel_id/control/disable_local_storage
--header 'Accept: application/json'
--header 'Authorization: Bearer 123'
--header 'Content-Type: application/json'
Path Parameters
channel_id*
String
The ID of the channel.
Example: exampleCH
client_id*
String
The ID of the client.
Example: exampleCL
partner_id*
String
The ID of the partner.
Example: examplePA
If you need any assistance, please reach out to our Support Team with the specific location, and we will configure this feature for you. Once enabled, you can see the configured local storage from the Partner Hub.
Set Default Data Localization Region Settings
Use this endpoint to set default data localization region to numbers associated to your Partner Account.
PATCH
https://hub.360dialog.io/api/v2 /partners/{partner_id}/settings/default_data_localization_region
Request Example
curl --request PATCH
--url https://hub.360dialog.io/api/v2/partners/partner_id/settings/default_data_localization_region
--header 'Accept: application/json'
--header 'Authorization: Bearer 123'
--header 'Content-Type: application/json'
--data '{ "default_data_localization_region": "string" }'
Path Parameters
partner_id*
string
Request Body
default_data_localization_region*
String
Allowed values: AU
, ID
, IN
, JP
, SG
, KR
, DE
, CH
, GB
, BR
, BH
, ZA
, CA
You can also configure this setting using the Partner Hub.
Once this region is configured, it will be used as default for all Cloud API numbers registered with your Partner Account.
Filter Options
You can apply filters on Partner API endpoints by specifying parameters in the request URL to narrow down the results returned by the API. Here's a example guide on how to use filters.
Get a specific Channel ID: GET https://hub.360dialog.io/api/v2/partners/{{partner_id}}/channels?filters={"id": "{{channel_id}}"}
How to use filter?
Example: GET https://hub.360dialog.io/api/v2/partners/partner-id/clients?filters={"contact_info":"abc@xyz.com"}
How to use sort?
Examples:
ascending:
https://hub.360dialog.io/api/v2/partners/partner-id/clients?sort=id
descending:
https://hub.360dialog.io/api/v2/partners/partner-id/clients?sort=-id
How to use filter?
Example: https://hub.360dialog.io/api/v2/partners/partner-id/channels?filters={"setup_info.verification_method":"sms"}
How to use sort?
Example:
ascending:
https://hub.360dialog.io/api/v2/partners/partner-id/channels?sort=id
descending:
https://hub.360dialog.io/api/v2/partners/partner-id/channels?sort=-id
Channel Statuses
The hub_status property indicates the channel status.
draft
Channel exists in the 360dialog Hub but is not synced with Meta
live
Channel is live
pending_deletion
Channel is pending deletion
unregistered
Channel is unregistered from the WhatsApp API
done OBO WABAs Only
Channel exists in the 360dialog Hub but not on Meta
pending OBO WABAs Only
Channel exists in the 360dialog Hub but is not synced with Meta
Granularity Filtering
You can use the granularity parameter to retrieve metrics about the conversations associated with the WhatsApp Business Account (WABA).
Specifically, you can get the number of messages sent and delivered as well as conversation and cost information for a given period. This parameter works together with the /balance
endpoint in the Partner API. See below how to parse your request.
Query Syntax: GET
/info/balance
?<FILTERING_PARAMETER>
Example
https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/info/balance
?
start_date
=1664582400
&
end_date
=1667260799
&
granularity
=day
Query String Parameters
<FILTERING_PARAMATERS>
Required.
Metric filtering parameter. Append additional filtering parameters using dots.
For possible values, see:
start_date=1664582400&end_date=1667260799&granularity=day
When calling the GET request, you can attach the following{filtering-parameters}
to retrieve the cost and conversation information for a specific WABA.
Filtering Parameters
start_date
type: UNIX Timestamp
Required. The start date in UNIX Timestamp (UTC). Returned data will be equal to or newer than the specified date.
Example: 1672531200
end_date
type: UNIX Timestamp
Required.
The end date in UNIX Timestamp (UTC). Returned data will be equal to or older than the specified date.
Example: 1672531200
granularity
type: String
Required.
The granularity by which you would like to retrieve the analytics. Supported Options:
DAY
MONTH
Defaults with MONTH
if no value is provided in the request.
app_id
type: array
Available only for Get Client Balance endpoint.
An array of app_ids
for which you would like to retrieve usage. If not provided, all app ids
in the WABA are included.
Usage data is approximate and may differ from what’s shown on invoices due to small variations in data processing.
With granularity parameters, you can filter and break down your results. See the code sample below for examples.
A successful response returns the usage
object with the data you have requested.
Last updated