Integration Guide

Email Integration

This guide details how to integrate Thrio with your email server.

April 2, 2019

TOPIC

Email

UPDATED

April 17, 2019

Thrio has the ability to receive a Web Form in the form of a REST API Call and turn it into an ACD email that will then have access to all standard email functionalities (email templates, queue routing, etc). In order to access the REST API call, developers need to get a token via the administrator. That token is valid for 6 months. There is no limit to the number of token you have access to.

Get a Token

  • To get a token, log in to the application with an administrator account. At the Tenant level, simply request a token via the token button.
  • The token will then be stored in the tenant and via a simple copy you can share the token with the developer.

REST API Call

  • The REST API call is a POST to https://login.thrio.com/hndlbar-service-provider/api/types/webform with the following JSON format. The header must have the key Authorization with the token and the Content-type to application/json.

{

“from”:”<from email address>",

"campaignId”:”<valid campaignId>”,

"type":"Email",

"properties": {

"subject”:”<Subject of the email>",

"htmlBody”:”<body of the email>"

},

"consumerData": {

“Name”: ”value 1”,

“Number of Agents”: “value 2"

}

}

REST API Call Configuration

  • From - A valid email address that the agent will use to reply
  • CampaignId or CampaignName - A valid campaignId or CampaignName that will be use to route the email into the system
  • Type - Future use, only type supported right now is Email
  • Properties - Text representing the subject of the email with a max length of 256 chars. Body of the email either valid HTML or text representation
  • Consumer Data - Key & Value pair information that will be stored with the email and presented to the agent. The key must match a field name in the survey if you need to populate the information of the survey with this information. The return value is a JSON object with the state to SUCCESS or ERROR and the expiration date of the token:

{

“state”: “<ERROR or SUCCESS>”,

tokenExpiration: “<number of milliseconds since January 1st 1970 representing the token expiration>"

}

  • 200 OK
  • A JSON object will be return upon success containing two fields, 1. expirationDate representing the expiration date of the token in a number of milliseconds since January 1st 1970 format (Unix timestamp) and 2. workitemId representing the id associated with the newly created work item.
  • 400 Bad Request
  • Invalid campaign name or camped id was used, correct the information and re-submit the information.
  • 401 Unauthorized
  • The token is invalid / expired, get an updated token from the tenant view.
  • 403 Forbidden
  • The token is invalid / expired, get an updated token from the tenant view.
  • 500 Internal Server Error
  • An unexpected exception occur, if this is returned you should contact support.