Basics of TringMe API

Before we get into the nuts & bolts of TringMe APIs, lets consider few use cases to understand typical API uses:

Use-case 1: Suppose you have a web portal where you would like to have a very easy-to-use way for your customers to call you. Customers can specify his or her number in a form on your website and then a call should be automatically initiated between both of you. Depending on your business-model, either you or your customer can bear the call-charges. To achieve this, you would typically expect following from the API:

  • A way to place the call
  • A way to check the call rates
  • Real-time status of the call (dialing, connecting, answered ... etc.) and associated call-charges to integrate with your website/application.
  • Precise call-record and billing information

Here is how TringMe API completely meets above requirements

  • Placing Call - TringMe provides REST & Flash APIs. Flash API will provide you a way to place the call directly from the browser. REST API gives you the callback mechanism to place the call (i.e. call will be placed to both the party separetely and then connected with each other).
  • Call Rates - Invoke REST API from your programming language to query exact rates for the call to the desired destination.
  • Real-time Notifications - You can specify a callback URL where TringMe will send real-time status updates of the call, including billing. This will enable seamless integration with your website to give that integrated user experience.
  • Call Records - Even if you do not use TringMe's real-time notification mechanism, you can access the call-records on-demand, anytime using TringMe's REST API. You can even tag the call-records for ease of indexing & searching.

Use-case 2:Taking the above use-case further, lets say that you wanted the ability for individual departments (sales, support, technical, finance) within your company to manage the calls separately - i.e. they should be able to interact with customers via calls and you want to get complete call records per department. To achieve this, you would typically require the following from the solution provider API:

  • Ability to create users (in this case, every department becomes a user).
  • Per user call records.
  • Per user call details.
  • Ability to set per user caller-id
  • Ability to manage per user credits.

Complete user-management capabilities are provided by TringMe APIs which make all the above fully possible. Infact user is a fundamental concept in TringMe API as explained below.


A TringMe User

In TringMe APIs, everything revolves around a user. For e.g. When you make a call, the call will be billed to a user. The call-record for that call will go into that user's call-records. That call will bear the caller-id of that user.

TringMe APIs allow you to create as many users as you would like and initiate an action on that user account. For e.g. depositing credits in that user account, making call or sending sms etc. For e.g. as you can see in the use-case 2 above, you can create a user for every department.

A user context in TringMe API is identified by a cookie. As you would've guessed by now, the cookie is used in most TringMe APIs to take action on behalf of that user.


What is a Cookie?

Cookie is an integral part of most TringMe APIs and identifies the user on whose behalf the action is being taken. For e.g. to place a call, you would pass a cookie and the billing of that call will be applied to the user to whom that cookie belongs.

Whenever a user logs-in, a cookie is assigned to that user. Read the login API to learn more.


Invoking APIs

You don't need to download any source-code or libraries to invoke TringMe APIs. TringMe API calls are made over the internet by sending the standardized HTTP GET or POST requests to TringMe's API server. For example, to get the TringMe user id, invoke a URL like this:

Sample Request URL

http://api.tringme.com/api.php ?apikey=12sdas8dadadsadajs3&
sig=4b61af9cd869706edc6a4569fc4e7b33 &op=getuid&
email=api@anexample.com

Ofcourse, we don't expect you to build these URLs from scratch and hence, TringMe provide easy to use helper functions to do this task. Helper functions can be downloaded from here.

If you are an enterprise and would like to know better how TringMe can help you reduce cost and at the same time benefit you,
please send a mail to bizdev@tringme.com