In this section of the documentation we’re going to describe how to work with our API by covering a few basic examples. Note that the purpose of it is not to cover every single detail of the API and its methods. For that, the appropriate resource is the API reference.

Basics

Our API uses REST with JSON-encoded content both in the requests and responses.

For that, we recommend setting the following headers in all your requests:

Content-Type: "application/json"
Accept: "application/json"

The base URL were we build all our documentation in top of is:

<https://api.edgetier.com>

Authentication

All the requests to this API require to be authenticated. In order to do so, you’ll need to get a key pair from some EdgeTier staff.

Once you get your API client ID and secret, you can use a standard OAuth2 approach to get a token to authenticate your other requests. You just need to issue a POST request to /oauth2/token with the following data on it:

{
    "client_id": "<your-client-ID",
    "client_secret": "<your-client-secret",
    "grant_type": "client_credentials",
}

And that will return a valid bearer token that you will just need to include in your requests as a header.

Authorization: "Bearer <your-token>"

Interactions

Interactions are the central object of our system. They represent any instance of communication between a contact centre and a customer, including chats, emails, calls, etc. (Check Interaction Types for more information).

Create Interactions

To create a new interaction we need to issue a POST to /interactions:

interaction_content = {
    "interactionType": "chat",
    "subject": "Customer Support Chat",
    "externalReference": "{\\"external_id\\": \\"external_system_1234\\"}", 
    "url": "<https://external-source.com/conversations/12345>", # URL of the chat in the source system
    "startDateTime": "2025-02-25T14:00:00Z", # Date in ISO 8601 format
    "enterQueueDateTime": "2025-02-25T14:00:00Z", # Date in ISO 8601 format
    "exitQueueDateTime": "2025-02-25T14:02:00Z", # Date in ISO 8601 format
    "endDateTime": "2025-02-25T14:23:00Z", # Date in ISO 8601 format
    "languageIsoCode": "en" # two letter ISO 639 format
    "senderEmail": "[email protected]", # Customer email
    "senderName": "John Doe", # Customer name
}
response = api_client.post("/interactions", interaction_content)

This request is creating a chat interaction without any content, in the following examples we’ll demonstrate how to add extra information to it.