get.chat Partner API (1.0.0)

Download OpenAPI specification:Download

API used for managing instances owned by get.chat Partners.


For configuring an existing instance, please see WhatsApp Integration API docs.


For white-labeling a front-end (in an iframe, or after redirect), please see Query Parameters section of open-sourced front-end repository.


Api Root (Health Check)

Use the root endpoint as a health-check of the API.

No authorization needed.

Responses

Response samples

Content type
application/json
{
  • "status": "healthy"
}

Api Version 1 Root Health Check

This endpoint is an alias to the same function as / endpoint.

No authorization needed.

Responses

Response samples

Content type
application/json
{
  • "status": "healthy"
}

Partner Id

Checks currently authenticated user Partner ID.

Use this endpoint to confirm that you're using an API Key related to the right Partner ID.

Authorizations:
APIKey

Responses

Response samples

Content type
application/json
{
  • "partner_id": "sandbox"
}

Create Instance

Deploys a new instance.

This endpoint will create a new instance containing inbox and integration API. It will allocate new cloud resources and will expose a new API bound to this instance. Note that allocation usually takes about 2-5 minutes until the instance (and API) is ready to use.

Examples

You can create a new instance in various ways. Here are the top 3 recommended methods.

Example 2 is the most recommended, and is best suited for automations.

Example 1 is good for a quick start.


Example 1: Quick start with no automation

If you have no automation set up yet, you can use generate_activation parameter.

When generate_activation is set to true, the admin account activation URL will be pre-generated and returned in the response to this request.

Pre-generated means the activation URL will be provided to you immediately after processing this request, but the activation URL is not yet ready to use. You need to await the health_check returned.

For example:

curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer LRoWRCjm1bdwlqDjfdYw" \
     -X POST \
https://api.inbox.platform.get.chat/v1/instances \
--data '{"subdomain": "mycompany-test", "channel_id": "ChAnElCH", "generate_activation": true}'

Above request will create a new instance for channel ChAnElCH, on subdomain mycompany-test, and a will pre-generate a new activation URL.

The response should look similar to:

{
  "id": "167c42d61ed64feb97d3a32508d811a8",
  "base_domain": "mycompany-test.inbox.platform.get.chat",
  "health_check": "https://mycompany-test.inbox.platform.get.chat/api/v1/status/health",
  "channel_id": "sAnDbCH",
  "partner_id": "sdBoXPA",
  "activation_url": "https://mycompany-test.inbox.platform.get.chat/confirm_account?c=a0a08b0e-f79c-4ec7-bbd4-a1697502bff0"
}

When received, you should await the provided health_check, to get to know when the instance is created, and ready to use.

When the health check returns 200 status code, you can open the activation_url in web browser, and:

  1. You will be automatically logged in to the admin panel
  2. Type a new password on the opened page
  3. Click "SAVE"

Done! Your password is now ready to use on the inbox admin panel and web frontend!

Additional notes:

  • On the admin panel, click three dots "..." icon on the top right side of the screen, and choose "Go to Web Inbox" to log in to the shared web inbox front-end.
  • You need to log in to the inbox front-end and admin panel separately

Example 2: Fully automated flow with Configurator User

Configurator User is an Admin user that should be used for configuring your integration. It is a service account that has several differences with other Admin users:

Configurator user:

  • can use automated authorization initialization
  • can use any API endpoints as an admin user, except messaging endpoints
  • cannot use web inbox front-end

Configurator User allows you to create a new instance in a fully automated way.

To do that, provide configurator parameter with all needed sub-params: user_name (required), webhook_url (required), webhook_headers (optional).

For example:

curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer LRoWRCjm1bdwlqDjfdYw" \
     -X POST \
https://api.inbox.platform.get.chat/v1/instances \
--data '{"subdomain": "mycompany-test", "channel_id": "ChAnElCH", "configurator": {"user_name": "service_account", "webhook_url": "https://example.com/webhook"}}'

Above request will create a new instance for channel ChAnElCH, on subdomain mycompany-test, and a new Configurator User named service_account. When instance will be ready to use, a webhook will be sent to https://example.com/webhook URL with following data:

{"token": "YOUR_TOKEN"}

where YOUR_TOKEN value contains a new Auth Token bound to your new Configurator User of this specific instance. See Integration API documentation for more information about Auth Token.

After receiving the Auth Token, your automation can act as the Configurator User, by interacting with API endpoints available under https://mycompany-test.inbox.platform.get.chat/api.


Example 3: Receive e-mail confirmation when instance is created

For the most convenient approach, you can make use of admin_email.

When provided, an e-mail will be sent to this address as soon as the instance is ready to use. E-mail message contains an activation link. You can activate your inbox admin user (instance admin user) by clicking on activation link.

For example:

curl -H "Content-Type: application/json" \
     -H "Authorization: Bearer LRoWRCjm1bdwlqDjfdYw" \
     -X POST \
https://api.inbox.platform.get.chat/v1/instances \
--data '{"subdomain": "mycompany-test", "channel_id": "ChAnElCH", "admin_email": "example@example.com"}'

Above request will create a new instance for channel ChAnElCH, on subdomain mycompany-test, and an admin account named "example@example.com".

When instance will be ready to use, an e-mail message will be sent to "example@example.com", with a title: "WhatsApp Inbox Activation".

In the e-mail message, there will be a sentence with link:

  1. Click here to activate your inbox and set your password: Activate

Click on the "Activate" link in the e-mail message, and then:

  1. You will be automatically logged in to the admin panel
  2. Type a new password on the opened page
  3. Click "SAVE"

Done! Your password is now ready to use on the inbox admin panel and web frontend!

Additional notes:

  • On the admin panel, click three dots "..." icon on the top right side of the screen, and choose "Go to Web Inbox" to log in to the shared web inbox front-end.
  • You need to log in to the inbox front-end and admin panel separately

Conclusions

We presented a few ways of creating a new instance via Partner API.

Example 1 focuses on providing to you a quick start, but presented workflow is not recommended when managing large volumes of clients.

Example 2 is the most recommended approach, fully utilizing potential of webhooks and your automation.

Example 3 is another convenience feature, that can be potentially useful when creating a new instance on behalf of your client, and when secure isolation of access to messaging is important.

Authorizations:
APIKey
Request Body schema: application/json
channel_id
string (Channel Id) <= 10 characters [a-zA-Z0-9]+

(This parameter is required if d360_api_key is not provided)

360Dialog channel ID to connect.

Our platform will collect a new 360Dialog API Key for this channel ID, and will connect a new instance to this channel ID.

IMPORTANT: Previous 360Dialog API Key for this channel ID will stop working!

d360_api_key
string (D360 Api Key) <= 50 characters [a-zA-Z0-9]+

(This parameter is required if channel_id is not provided)

Existing 360Dialog API Key that you want to use to deploy a new instance

subdomain
string (Subdomain) <= 63 characters ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a...

Optional sub-domain of a public base domain at which the instance will be available.

Leave blank to use auto-generated instance ID. For example, "sandbox" subdomain ends up with a public base domain equal to "sandbox.inbox.platform.get.chat".

Max length is 63, because of RFC 1035: each label in a domain has a limit of 63 characters.

If subdomain is already in use, 422 status code is returned from API and following payload: {"loc":["subdomain"],"msg":"subdomain already in use: mysubdomain","type":"string"} (Replace mysubdomain with subdomain provided during request.

admin_email
string <email> (Admin Email)

Optionally provide an e-mail address that will be used as admin user name.

When provided, an e-mail will be sent to this address as soon as the instance is ready to use. E-mail message contains an activation link. You can activate your inbox user (instance user) by clicking on activation link, and setting your password.

generate_activation
boolean (Generate Activation)
Default: false

When set to true, the admin account activation URL will be pre-generated and returned in the response to this request.

Pre-generated means the activation URL will be provided to you immediately after processing this request, but the activation URL is not yet ready to use. You need to await the health_check returned, or wait for Configurator User webhook (provided in configurator.webhook_url)

When any of those two happens, it means the instance is ready to use, and activation URL can be opened (requested).

Note that you don't need to pre-generate the activation URL in following cases:

  • you create a Configurator User with configurator.webhook_url param set, and you will receive and use Auth Key provided to that webhook
  • or you provide admin_email param, and you will use the activation URL sent to that e-mail address
object (ConfiguratorModel)

Parameters of a new Configurator User that will be created when creating this new instance. Configurator User is an Admin user that should be used for configuring your integration. It is a service account that has several differences with other Admin users:

Configurator user:

  • can use automated authorization initialization (see configurator.webhook_url parameter)
  • can use any API endpoints as an admin user, except messaging endpoints
  • cannot use web inbox front-end

(Click "configurator" on the left, for details)

max_number_of_seats
integer (Max Number Of Seats)
Default: 5

Configures a limit of maximum number of parallel agent seats on this instance.

Responses

Request samples

Content type
application/json
{
  • "channel_id": "sAnDbCH",
  • "d360_api_key": "string",
  • "subdomain": "sandbox",
  • "admin_email": "user@example.com",
  • "generate_activation": false,
  • "configurator": {
    },
  • "max_number_of_seats": 5
}

Response samples

Content type
application/json
{}