Overview

This page describes our Partner API.

The 360dialog Partner API follows REST principles. It uses predictable, resource-oriented URLs, accepts form-encoded request bodies, returns JSON-formatted responses, and relies on standard HTTP methods, authentication mechanisms, and response status codes.

The 360dialog Partner API enables the programmatic management of WhatsApp Business Accounts and phone numbers. It enables Partners to automate workflows and build a seamless onboarding and management experience for their clients.

To get started, you will need:

  • Partner ID

  • Partner Hub login credentials

Partner ID

The Partner ID is a unique identifier used for most Partner API requests. You can find your Partner ID by logging into the 360dialog Partner Hub in your browser and navigating to the Partner Integration section.

Login Credentials

When a Partner account is created, you will receive an email invitation to activate the account and set a password.

Base URL

The default base URL for the 360dialog Partner API is https://hub.360dialog.io/api/v2

Authentication

The Partner API supports two authentication methods:

  • API Key (Recommended)

  • Bearer Token

Partner API Key and Bearer Tokens are only intended for API calls to hub.360Dialog.io/* .

For the Messaging API ( https://waba-v2.360dialog.io/* ) the supported authentication method is through the use of D360-API Keys. Adding D360-API-KEY in the header with your Client's unique API Key as a value will grant access to Messaging API. See how to retrieve an API key here.

Allows secure access to the Partner API without requiring user credentials. Each request must include a valid API key in the request headers.

How to Obtain an API Key

  • Navigate to the API Keys section in the Partner Dashboard

  • Generate an API key. Store the key securely, as it grants access to the Partner API. It will only be displayed once

Using the API key

Include the API Key in the request header:

Example Request

Best Practices for API Authentication

  • API Keys Usage: Use API Keys for service-to-service communication.

  • API Keys Rotation: Rotate keys periodically to maintain security.

  • Secure Storage: Always store API keys and credentials securely. Avoid exposing them publicly or hardcoding them in client-side code - use environment variables instead.

  • Error Handling: Handle authentication errors gracefully. Common errors include:

    • 401 Unauthorized: Invalid or missing authentication credentials.

    • 403 Forbidden: Valid credentials, but insufficient permissions.

Bearer Token Authentication (Deprecated)

Bearer Token authentication is still supported, but it is not recommended for use.

chevron-rightShow instructionshashtag

To obtain a Bearer Token, provide your username (email) and password.

Request OAuth token for any Partner API request

POST https://hub.360dialog.io/api/v2/token

Request example

Request Body

Name
Type
Description

username*

string

password*

string

Example: 123StrongPass4Me!

Response:

After the token is received, use this access token in the authorization header:

Partner Webhook URL

A Webhook URL is required to receive notifications for certain events relating to a Partner Account and connected Client Accounts. You can set a Partner URL in the Partner Hub UI or via API endpointarrow-up-right.

Filtering and sorting the API output

Filtering

Allows results to be narrowed down.

For users running curl in a Bash or Linux environment: Because filtering syntax utilizes special characters like { and }, you must escape these symbols with a backslash (\).

Filtering Examples

Get a specific channel.

Get a client by contact email.

Filter channels by channel property.

Filtering options

Sorting

Allows results to be ordered as needed.

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

Sorting options

Retrieving Conversation and Cost Analytics

This endpoint allows to retrieve metrics about the conversations associated with the WhatsApp Business Account (WABA).

It's possible to 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 the request.

Query Syntax: GET/info/balance?<FILTERING_PARAMETER>

Example

Query String Parameters

Placeholder
Description
Example Value

<FILTERING_PARAMATERS>

Required.

Metric filtering parameter. Append additional filtering parameters using dots.

For possible values, see:

Filtering Parameters

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

Name
Description

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.

circle-info

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.

Channel Statuses

The availability_status property indicates the readiness of a channel for manage traffic.

Status

Description

ready

The channel is fully onboarded and configured to handle traffic.

setting_up

The channel is in the final stages of the onboarding or migration process.

error

The channel is in a non-operational state due to a configuration issue or failure that prevents it from being used, and it is not in the process of being set up.

Last updated

Was this helpful?