chat

CLICK TO CHAT

1. Introduction

General

The REST API enables VoIPstudio customers to access to a wide range of resources. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.

Endpoints

The base URL for the API id:

https://l7api.com/v1/voipstudio/

Authentication

Communications between customer applications and VoIPstudio's API are secured through HTTP basic authentication over SSL.

Before sending requests to the API you must login first using your email address and password or REST API key assigned to your account. After successful authentication the API will return unique user_id and user_token that should be used for further communication.

E-mail and Password

Login request using e-mail and password:

  curl -H "Content-Type: application/json" -X POST -d '{"email":"jsmith@example.com","password":"$ecretPas$$"}' https://l7api.com/v1/voipstudio/login

Example request:

POST /v1/voipstudio/login HTTP/1.1
User-Agent: curl/7.26.0
Host: l7api.com
Accept: */*
Content-Type: application/json
Content-Length: 55
Connection: close

{"email":"jsmith@example.com","password":"$ecretPas$$"}

Example of successful response:

  {
    "message":"Login success",
    "user_token":"8e9bc12575e639c993ba5dd8a0e7ce2250211b9a",
    "user_id":123456
  }

REST API Key

Login using REST API key:

  curl -H "Content-Type: application/json" -X POST -d '{"api_key":"00686665f1e2281f2f501a27a4ff7a8fe535e556611"}' https://l7api.com/v1/voipstudio/login

Example request:

POST /v1/voipstudio/login HTTP/1.1
User-Agent: curl/7.26.0
Host: l7api.com
Accept: */*
Content-Type: application/json
Content-Length: 55
Connection: close

{"api_key":"00686665f1e2281f2f501a27a4ff7a8fe535e556611"}

Example of successful response:

  {
    "message":"Login success",
    "user_token":"8e9bc12575e639c993ba5dd8a0e7ce2250211b9a",
    "user_id":123456
  }

Communication

Authentication to the API is performed via HTTP Basic Auth. This type of authentication should be a straightforward operation in language that you are using. Incoming requests handled by our API are expected to have a special header with a base64 encoded value build from user_id and user_token return from successful "login" response. To get this base64 value, encode your user_id and user_token separated by a semicolon.

Authorization header is expected in format:

Authorization: Basic base64('user_id:user_token')

Example of proper request:

curl -H "Content-Type: application/json" -H "Authorization: Basic base64('user_id:user_token')"  https://l7api.com/v1/voipstudio/cdrs

or simply:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/cdrs

HTTP response

VoIPstudio REST API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.), and codes in the 5xx range indicate an server error.

Each successful response depending on HTTP method contains properties:

  • GET collection of resources:

    • data - array of resources data
    • total - total number of resources
  • GET single resource"

    • data - resources data
    • links - links to related resources

Each error response contains properties:

  • message - general error message
  • errors - array of error messages

Pager and filters

For data collection endpoints such as GET https://l7api.com/v1/voipstudio/cdrs pager can be used to return specific number of records from given page in the data set. To apply pages please append the following parameters to the URL ?page=N&limit=Z where N is a page number and Z is number of records to be returned (maximum 5000).

To filter data filter parameter can be passed as URL query string. The value of filter parameter has to be JSON encoded string in format as below:

[
   {"operator":"like","value":"United States","property":"name"},
   {"operator":"eq","value":10,"property":"price"}
]

Groupping records

group_by parameter is available for groupping record by specific property: ``GET https://l7api.com/v1/voipstudio/cdrs?group_by=src`. This parameter should by passed as URL query string.

30-day free trial

You can take a 30-day FREE trial of VoIPstudio with absolutely no obligations.
A simple web-based portal gives you total control over all your telephony requirements.
Ready to take your business to new heights?

Start a FREE 30-day trial