How to configure the integration with your system via Ringostat API

Ringostat API (application program interface) is a set of routines, protocols, and tools for building software applications. It is possible to use them for setting the integration of your project in Ringostat with your CRM or another system.

Using this method you can send the requests to our server for getting the required action or data from it.

To configure the integration with your system via API method you should set the request with the required parameters.

The main details for the requests:

  1. Ringostat API address - https://api.ringostat.com/
  2. Access to Ringostat API you can get with unique Project ID and token.

Project ID — is the unique ID of your project.

A (security) token is an electronic key to access your project in Ringostat.


How to find the project ID and the token:


You may find it in one of the integration sections. For example, in the section of Alytics integration, where Login is the project ID and Password is the token.




Parameters, you can export from your project statistics.

Required settings for exporting the parameters to your system via API method:

  1. The format of the requests — json or csv.
  2. Method of the data export — GET.
Examples:
  1. Request:

https://api.ringostat.com/calls/export?project_id=999&token=be6d748913ccb22f2bv555555555c&export_type=json&from=2016-05-05%2010:00:00&to=2015-06-06%2010:00:00&fields=caller,disposition,calldate,duration&merge=1&order=calldate%20asc

Result:


2. Request:

https://api.ringostat.com/calls/export?project_id=999&token=be6d748913ccb22f2bv555555555c&export_type=json&from=2016-06-02%2000:00:00&to=2016-06-08%2000:00:00&fields=caller,dst,connected_with,utm_source,utm_medium,remote_ip,recording&merge=1&order=calldate%20asc

Result:


3. Request:

https://api.ringostat.com/calls/export?project_id=999&token=be6d748913ccb22f2bv555555555c&export_type=json&from=2016-05-05%2000:00:00&to=2016-06-06%2010:00:00&fields=disposition,calldate,refferrer&filters=duration%3C10

Result:


The callback methods:

1. To set a callback to the visitor, who filled up the form on your web page you’ll need (simple method):

  • Method of the API request — POST;
  • Project ID — is the unique ID of your project.
  • A (security) token is an electronic key to access your project in Ringostat.
  • Extension - the SIP-account or the phone number in the international format you want to make a call from.
  • Destination - a phone number you are going to call (in the international format).

Request example:

https://api.ringostat.com/callback/outbound_call?project_id=999&token=be6d748913ccb22f2bv555555555c&extension=380441111111&destination=380442222222

2. In case you’d like to set the same callback to your visitor but from the number, which is not connected to the project, you should use the expand method for the callback via API.

*You can get this key only for your active project.

  • Headers (request header) – defines the exported data type:

content-type: application/json

Auth-Key: <authorisation key>

  • Body(request body) – consists of the array with the exported parameters:

{ "jsonrpc": "2.0",

"id": <use any digit>,

"method": "Api\\V2\\Callback.external",  -  the name of the method

"params":

{

required parameters:

"caller": " <the number in the international format>",   - the number of the client, who left the request for the call

"callee": " <the number in the international format>",   - the agent number, who answered the call

"projectId": " the project ID",

"clientIp": " visitor’s address",   - the visitor’s IP-address who left the request for the call

non-required parameters:

"utmSource": " the source",

"utmMedium": " the traffic channel",

"utmCampaign": " the campaigne",

"utmTerm": " the key-word",

"utmContent": " the adds content",

"clientId": " Client ID Google Analytics",

"clientUserAgent": " the custom system, which you use for the access" }}

As you see, there’re required parameters as Auth-key, caller, callee, projectID and clientIP. The other ones should be in the request either but can have the value = Null.

The call will be successful in case the title and the body of the request are correct. It also depends on the parameters caller and callee - they should be valid too.

To add the non-required parameters to the request you should eject them with your script. For example, utm-parameters can be ejected from the cookie-file rngst2, and the ClientID Google Analytics - from the cookie-file _ga.

Example:

The result which you’ll see in the Call log:


The errors you might have:

1. If the main parameters caller, callee, Auth-Key, clientIP were not valid and you might get the answer 403.

2. If the parameters caller or callee are not valid or empty and you might get the answer 400.


The methods which checks if the SIP-account is reachable:

This methods can be useful for monitoring quality of the agents' work and availability.

3.1. The method for monitoring the SIP-accounts which are online.

  • API format: json;
  • API method type: GET.

Example:

https://api.ringostat.com/sipstatus/siponline?project_id=999&token=be6d748913ccb22f2bv555555555c

The result:

3.2. The method for monitoring the SIP-account, which are participated in the call.

  • API format: json;
  • API method type: GET.

Example:

https://api.ringostat.com/sipstatus/speakingNow?project_id=999&token=be6d748913ccb22f2bv555555555c

The result:



In case you need any assistance feel free to contact our Support team via chat or through the email support@ringostat.com.

Is article helpful?