CPaaS API provides a programming interface to enable these services by creating, managing projects, configuring services therein, and getting reported.

Table of Contents

Overview

CPaaS API helps easily integrate Video into Third Party Applications. Here are some interesting key points:

Accessibility

CPaaS API can be accessed using Server-to-Server Call using HTTP Base Authentication. This helps Developers to integrate API Server based Application.

Role Based Authorization

Role-based access to different API Routes and data therein. API gives access to data in the following hierarchy:

  • Administrators – Role Access to data of Customers.
  • Customers – Role Access to own data.

Basic Functions

  • Project Management
  • Data Pool Management
  • Report Management

API Host URL

API Host: https://api.enablex.io/cpaas/

All CPaaS API Routes are mapped to the API Host URL, e.g.

Project Route URL: https://api.enablex.io/cpaas/projects

API Authentication

HTTP Basic Authentication – For Server to Server API Call

The CPaaS API uses HTTP Basic Authentication mechanism to authenticate API calls. Each API call is validated via the authentication header. This suits best to integrate EnableX with Server Side Code. The API Access Credentials be saved on Server and used for Server-to-Server Call.

You need API ACCESS ID and API ACCESS KEY for HTTP Basic Authentication. These are to be used as API Access Credentials from your Application Server in each API Call.

  • API ACCESS ID: Use it as username for HTTP Base Authentication
  • API ACCESS KEY: Use it as password for HTTP Base Authentication
POST https://api.enablex.io/cpaas/projects
Authorization: Basic XXXXXX    
Content-Type: application/json

The Authorization header in the above example contains a value XXXXX which is a base64 encoded string of the API ACCESS ID:API ACCESS KEY.

How to get API ACCESS ID & API ACCESS KEY

Every Customers can get access to API Access for Application Integration. To get API Access Credentials, follow the given steps:

  • Login to EnableX CPaaS Portal
  • Navigate: {Main Menu} Developers / API Access
  • Click “Generate API Credentials” (If you are first time API User). Subsequently, you will get API Credentials readily available on this page.

API Responses

The CPaaS API call  make use of  JSON Result Code to determine if the API call is successful.

Success JSON

Successful CPaaS API calls will always return HTTP 200 with JSON Body having Result Code as result: 1.

{	"result": "1",
	"data": {
		 
	}
}

The data object is optional and its a dummy name. It will be named after requested data and will contain related key-fields.

Error JSON

If unsuccessful, for whatever reason, the UCaaS API will return a JSON with a non—zero result code. An error response in JSON will always carry 3 keys, viz. Result Code, Error, Description. See example below:

{	"result": "1504",
	"msg": "Duplicate data",
	"desc": "Email Address is already registered",
	"data": {
		"email": "[email protected]"
	}
}

Result Code Grouping

The HTTP Response Codes of CPaaS API are grouped into 5 categories as shown in the table below:

CodeCategoryDescription
1xxInformationRequest received & processed.
2xxSuccessRequest received & accepted.
3xxRedirectionAction required to complete Request.
4xxClient ErrorIllegible Request Syntax. Can’t be fulfilled.
5xxServer ErrorServer failed to complete a legit Request.

Error Codes

Common HTTP Status Codes

CodeDescription
200OK success status: the request has succeeded.
400Header is missing. Add a valid header.
401Invalid header used.
403Token has expired.
404Not Found.
406Unprocessable entity, validation failed.
500Internal Server Error.
1001Token is not valid.
1002The request is invalid.

Application Specific Common Error Codes

CodeDescription
0Error.
1Success.
1401App type must be specified.
1402App type must be a string.
1403Only Valid app-type should be passed.