Introduction
This document will help you to use REVE Chat’s messaging API for automating and enhancing the overall quality of your customer service.
Basic API Usage
All REVE Chat API requests start with https://api.revechat.com/api/
The next segment of the URI path depends on the type of request. For example: https://api.revechat.com/api/agents to get agents data.
The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests.
In Windows, you'll need to modify some of the examples in the docs to make them work.
Authentication
You must use your login (user email address) and password for each method call. You'll set it while signing up your REVE Chat profile. Authentication to the API occurs via HTTP Basic Auth. The user email address and password is encoded in base64, and added in the header under Authorization tag as "Basic {base64 value}".
Example:
Authorization: Basic cy51dnJvMTY3QGdtYWlsLmNvbToxMjM0NTY3OA==
Here, 'cy51dnJvMTY3QGdtYWlsLmNvbToxMjM0NTY3OA==' is ( useremail : password ) encoded in base64
Provide your login as the basic auth user email address and the password as the password. You must authenticate for all requests. All API requests must be made over HTTPS.
Rate Limit
The REVE Chat API is rate limited. We only allow a certain number of requests per minute. We reserve the right to adjust the rate limit for given endpoints in order to provide a high quality of service for all clients. If the rate limit is exceeded, REVE Chat will respond with a HTTP 429 Too Many Requests response code, a body that details the reason for the rate limiter kicking in, and the amount of time you have to wait for making further requests.
Request Format
All the API requests in REVE Chat API are done through GET method. The Endpoints can be invoked by API calling with optional query parameters. The parameters undergoes validation in order to follow certain input format, which are described in their respective sections below. In case of invalid format, the system returns error consisting of status code and probable root cause.
While using multiple query parameters, the system returns errors for each and every input parameter. Hence, you will find all the error messsages for all the invalid input parameters, if any case of multipule invalid parameters. All API requests must be made over HTTPS.
Response Format
For each valid request, REVE Chat API returns response in "application/.json" type. All the resultsets are in .json format for later usability.
While encountering any errors, the system generates error status code and error message containing possible root cause of error, and returns it in "application/.json" format.
Date Format
In REVE Chat API, all the dates are managed in UTC time, i.e., GMT+0.
Hence, the REVE Chat system assumes the input date range parameters for searching purposes to follow UTC time. We accept the date range parameters to in "yyyy-MM-dd" format, any other format will raise error. Additionally, in response, the values are returned in milliseconds equivalent to the date-time in UTC time. Example: To query results in date range from December 20th, 2015 to December 25, 2016,
The query parameter would be:
'date_from'=2015-12-20
'date_to'=2016-12-25
The response would be:
'conversation_start_time' = 1436421339738 = Thu Jul 09th, 2015 05:55:39 GMT+0000
'conversation_end_time' = 1436422378082= Thu Jul 09th, 2015 06:12:58 GMT+0000
Time Zone
By default, the TimeZone for all the date are considered to be in UTC time, i.e., GMT + 0. While using the api you must consider adding additional GMT offset in order to convert the date & time to your desired timezone. Example:
If your timezone is New York (NY), which is GMT-5, and your time is 01:00 PM. In this case, all you have to do is add the GMT offset, in this case it is (-5), to the api date results in order to get it in NY TimeZone.
Here, the 'conversation_start_time', in date format, is = July 09th, 2015 05:55:39.
So, the 'conversation_start_time', in NY TimeZone, will be = July 09th, 2015 00:55:39.
Similarly, for searching through date range, kindly use date ranges that are in GMT+0. Example:
For querying results from July 08th, 2015 01:00:00 to July 10th, 2015 02:00:00, in NY TimeZone, use the query parameter:
'date_from'=2015-07-07
'date_to'=2015-07-09
Any questions? Please email us at support@revechat.com
Last updated