Download OpenAPI specification:Download
This guide describes list of API services that are provided by OT Rainbow metrics portal.
REST interface is used for sending/receiving OT rainbow API messages. HTTP requests GET, DELETE, POST, UPDATE are used. Standard HTTP responses are used to provide requested information or error status. There is no session notion in OT Rainbow system, so requests could be issued according stateless model, without transport conservation between them. Additional data could be provided in message body. JSON is used as a main format for data encoding in message body part. Each request is started with the following pattern /{module}/{version}/ where {module} is a portal module name to address and {version} is a version of used API, par example, “v1.0”.
Each request should contain some credential information to authenticate itself. Standard HTTP authentication with basic/bearer modes is used. JSON Web Token mechanism is used to provide authentication information. JWT has a expire timeout that is controlled by OT Rainbow portal to prevent very long token usage. Also authentication with application token is used. The token must be provided in the request HTTP header, using a custom header: APIKey. At server side, token is verified, and if it doesn’t match, 403 Not Allowed response is sent. TLS is used as a transport protocol to support message exchanges between OT Rainbow portal and an application.
For accessing the API a valid JWT token or a valid OAuth has to be provided access token must be passed in all the queries in the 'Authorization' header.
Security Scheme Type | API Key |
---|---|
Header parameter name: | Authorization |
This API can be used to retrieve stats of all companies under the given bpadmin
companyId required | string Company unique identifier (like 578bb08dc0d8c107725ef8c4). |
limit | number Default: 100 Allow to specify the number of stats to retrieve. |
offset | number Allow to specify the position of first stats to retrieve (first app if not specified). Warning: if offset > total, no results are returned. |
sortOrder | number Default: 1 Enum: -1 1 Specify order when sorting stats list (sort is done on users.total field). |
accept required | string application/json |
{- "data": [
- {
- "companyId": "595f7c109b43a2ba5dcbb1f9",
- "scope": "bp",
- "bps": [
- "595f7c109b43a2ba5dcbb1f9"
], - "companies": 7,
- "companyName": "Chin BP company",
- "subscriptions": {
- "enterpriseMax": 39,
- "businessMax": 35
}, - "systems": {
- "oxe": 1,
- "oxo": 1,
- "dailyConnected": 1
}, - "users": {
- "funnel": 2,
- "total": 45,
- "dailyConnected": 2,
- "weeklyConnected": 2,
- "monthlyConnected": 2,
- "newUser": 0,
- "registered": 43,
- "activeUsers": 35
}, - "usages": {
- "activeUser": 4,
- "_any": {
- "_any": 184
}, - "_clients": {
- "mobile_android": 20,
- "mobile_ios": 6,
- "other": 10,
- "web_win": 8,
- "node": 20,
- "desk_win": 138,
- "desk_osx": 24
}, - "_types": {
- "chat": 20,
- "file": 6,
- "groupchat": 10,
- "meeting": 8,
- "webrtc": 20,
- "webrtc_missed": 138,
- "conf": 24
}
}, - "lastDataCollectDate": "2018-02-12T00:00:00.000Z",
- "id": "5a4f47869e8ef2d74f74e520"
}, - { }
], - "limit": 100,
- "offset": 0,
- "total": 8
}
This API can be used to retrieve stats for a given company or grouped stats of all companies under a given BP company
companyId required | string Company unique identifier (like 578bb08dc0d8c107725ef8c4). |
scope | string Default: "ec" Allow to specify if the returned stats are from all companies under bp and itself (scope=bp) or stats concern only the specified company (scope=ec). |
accept required | string application/json |
{- "companyId": "595f7c109b43a2ba5dcbb1f9",
- "scope": "bp",
- "bps": [
- "595f7c109b43a2ba5dcbb1f9"
], - "companies": 7,
- "companyName": "Chin BP company",
- "subscriptions": {
- "enterpriseMax": 39,
- "businessMax": 35
}, - "systems": {
- "oxe": 1,
- "oxo": 1,
- "dailyConnected": 1
}, - "users": {
- "funnel": 2,
- "total": 45,
- "dailyConnected": 2,
- "weeklyConnected": 2,
- "monthlyConnected": 2,
- "newUser": 0,
- "registered": 43,
- "activeUsers": 35
}, - "usages": {
- "activeUser": 4,
- "_any": {
- "_any": 184
}, - "_clients": {
- "mobile_android": 20,
- "mobile_ios": 6,
- "other": 10,
- "web_win": 8,
- "node": 20,
- "desk_win": 138,
- "desk_osx": 24
}, - "_types": {
- "chat": 20,
- "file": 6,
- "groupchat": 10,
- "meeting": 8,
- "webrtc": 20,
- "webrtc_missed": 138,
- "conf": 24
}
}, - "lastDataCollectDate": "2018-02-12T00:00:00.000Z",
- "id": "5a4f47869e8ef2d74f74e520"
}
This API can be used to retrieve daily stats for a given company or grouped stats of all companies under a given BP company
companyId required | string Company unique identifier (like 578bb08dc0d8c107725ef8c4). |
scope | string Default: "ec" Allow to specify if the returned stats are from all companies under bp and itself (scope=bp) or stats concern only the specified company (scope=ec). |
accept required | string application/json |
{- "companyId": "58384af3d8279feeccc61984",
- "scope": "ec",
- "bps": [ ],
- "companies": 0,
- "companyName": "Ma boite",
- "dailyStats": [
- {
- "date": "2018-02-12T00:00:00.000Z",
- "systems": {
- "oxe": 1,
- "oxo": 1,
- "dailyConnected": 1
}, - "users": {
- "funnel": 2,
- "total": 45,
- "dailyConnected": 2,
- "newUser": 0
}, - "usages": {
- "activeUser": 4,
- "_any": {
- "_any": 184
}, - "_clients": {
- "mobile_android": 20,
- "mobile_ios": 6,
- "other": 10,
- "web_win": 8,
- "node": 20,
- "desk_win": 138,
- "desk_osx": 24
}, - "_types": {
- "chat": 20,
- "file": 6,
- "groupchat": 10,
- "meeting": 8,
- "webrtc": 20,
- "webrtc_missed": 138,
- "conf": 24
}
}
}, - { }
]
}
This API can be used to get stats (aggregated if BP) of first level customers for a given BP. If the company is an EC, it returns stats of this EC only.
The response of this API can be used to easily build a CSV file for an export of the analytics docs.
companyId required | string Company unique identifier (like 578bb08dc0d8c107725ef8c4). |
accept required | string application/json |
{- "data": [
- {
- "_id": "5a9675ebfcf551ff0a901059",
- "stats": [
- {
- "companyId": "5a9675ebfcf551ff0a901059",
- "scope": "bp",
- "companies": 1,
- "companyName": "My company",
- "systems_oxe": 1,
- "systems_oxo": 1,
- "systems_dailyConnected": 1,
- "subscriptions_enterpriseMax": 39,
- "subscriptions_businessMax": 35,
- "users_funnel": 2,
- "users_dailyConnected": 2,
- "users_weeklyConnected": 2,
- "users_monthlyConnected": 2,
- "users_registered": 43,
- "profiles_business": 4,
- "profiles_enterprise": 5,
- "profiles_conference": 6,
- "usages_activeUsers": 4,
- "usages_any": 226,
- "usages_mobile_android": 20,
- "usages_mobile_ios": 6,
- "usages_other": 10,
- "usages_web_win": 8,
- "usages_node": 20,
- "usages_desk_win": 138,
- "usages_desk_osx": 24,
- "usages_chat": 20,
- "usages_groupchat": 10,
- "usages_file": 6,
- "usages_meeting": 8,
- "usages_webrtc": 20,
- "usages_webrtc_missed": 138,
- "usages_conf": 24
}
]
}
]
}
Rainbow users with developer role can create applications and can retrieve CPaaS metrics for their own applications.
'fromDate' parameter to 'toDate' parameter range are restricted according the value of 'period' parameter:
applicationId required | string Application unique identifier (like 578bb08dc0d8c107725ef8c4). |
fromDate required | string <date-time> Allows to filter CPaaS counters from provided date (ISO 8601 format, ex: 2018-08-01T09:30:00Z).
|
toDate required | string <date-time> Allows to filter CPaaS counters until provided date (ISO 8601 format, ex: 2018-08-07T18:00:00Z).
|
period | string Default: "hour" Enum: "hour" "day" "month" Aggregation period, if not provided default value is 'hour' |
groups | string Allows to filter CPaaS counters for specific CPaaS metric groups: groups should be comma separated (like login,users,administration) |
timezone | string Default: "UTC" Allows to filter CPaaS counters using a specific time zone. |
{- "data": [
- {
- "groupCounters": [
- {
- "group": "login",
- "count": 16
}, - {
- "group": "users",
- "count": 145
}, - {
- "group": "subscriptions",
- "count": 7
}, - {
- "group": "administration",
- "count": 39
}
], - "aggregationStartDate": "2017-10-25T14:00:00.000Z"
}, - {
- "groupCounters": [
- {
- "group": "login",
- "count": 3
}
], - "aggregationStartDate": "2017-10-25T15:00:00.000Z"
}
], - "aggregationPeriod": "hour"
}
Retrieve the mapping of CPaaS metric groups.
{- "data": {
- "administration": [
- "administration",
- "applications",
- "billing",
- "provisioning",
- "subscriptions",
- "technical"
], - "resources": [
- "bots",
- "bubbles",
- "calendar",
- "calllog",
- "channels",
- "company",
- "conference",
- "contactpresence",
- "conversations",
- "files",
- "geoloc",
- "groups",
- "guests",
- "instantmessages",
- "instantmessagesack",
- "instantmessagesinbubbles",
- "invitation",
- "login",
- "mobile",
- "mypresence",
- "office365",
- "pbxtelephony",
- "recording",
- "roster",
- "users",
- "vcards"
]
}
}
Rainbow users with developer role can create applications and can retrieve CPaaS metrics for their own applications.
'fromDate' parameter to 'toDate' parameter range are restricted according the value of 'period' parameter:
ownerId required | string Owner unique identifier. |
fromDate required | string Allows to filter CPaaS counters from provided date. |
toDate required | string Allows to filter CPaaS counters until provided date. |
period | string {hour, day, month} Aggregation period, if not provided default value is 'hour' |
groups | string Allows to filter CPaaS counters for specific CPaaS metric groups: groups should be comma separated (like login,users,administration) |
dcZones | string Allows to filter CPaaS counters for specific dcZone(s): dcZones should be comma separated (like EU,NA). |
timezone | string Default: "UTC" Allows to filter CPaaS counters using a specific time zone. |
{- "data": [
- {
- "groupCounters": [
- {
- "group": "login",
- "count": 16
}, - {
- "group": "users",
- "count": 145
}, - {
- "group": "subscriptions",
- "count": 7
}, - {
- "group": "administration",
- "count": 39
}
], - "aggregationStartDate": "2017-10-25T14:00:00.000Z"
}, - {
- "groupCounters": [
- {
- "group": "login",
- "count": 3
}
], - "aggregationStartDate": "2017-10-25T15:00:00.000Z"
}
], - "aggregationPeriod": "hour"
}