Request/Response
Request
Our REST APIs enable you to access various capabilities to complete your integration based on the requirements for your use case.
You can leverage these requests using the common HTTP methods:
- GET - retrieves data from 100ms server. Example: Retrieve details of a specific room
- POST - sends new data to 100ms server. Example: Create a room
- DELETE - removes existing data from 100ms server. Example: Delete a role from a template.
Content type
The input of the request should be of the type application/json. The payload for all POST requests should be passed as a JSON object with the Content-Type as application/json
.
Most of the GET request arguments must be passed as a path param whereas some of the APIs accept it as a query param.
DELETE request arguments should be passed as a path param.
Headers
Name | Value | Required |
---|---|---|
Content-type | application/json | Yes |
Authorization | Bearer <management token> | Yes |
Response
100ms API responds to all requests with a response in JSON format along with an HTTP status code to indicate whether the request was successful.
HTTP status codes
All requests return one of these standard HTTP status codes
Code | Description |
---|---|
200 - OK | The request has succeeded. |
204 - No Content | Resource deleted. |
401 - Unauthorized | No valid API management token provided. |
403 - Forbidden | The API management token provided doesn't have enough permission. |
404 - Not Found | The request resource was not found. |
500 - Server Error | Something went wrong with 100ms servers. (These are rare). |
Errors
API responses with
4XX
and5XX HTTP status codes
indicate that the request has failed.4XX
: This can be either 401 or 403 or 404. You can refer to the status codes section for more information. Also, the response body will contain the error message that will help to resolve the error and resend the request.Example:
{ "code": 404, "message": "Error: Room not found", "data": { "description": "Error: Room not found" } }5XX
: Server errors. This happens when something is wrong with 100ms servers(these are rare).
Pagination
All API resources support bulk fetches via “list” API methods (For example, list all rooms). These APIs use query parameters - limit, start, and last - to support pagination.
To fetch the first page of 10 objects, set limit=10
as a query param. This API will respond with a list of objects in key data
. The response also has key last
with the unique identifier for the last object in data
.
To fetch the second page of 10 objects (11 to 20), pass the previous last
value as the start
query param. Set limit = 10
and start = <last value from previous response>
.
List API response variables
Name | Type | Description |
---|---|---|
limit | int | Number of objects the API tried to find. If returned array has lesser number of results, only those number were found. |
data | array | Array of objects. |
last | ObjectID | The last object in the list of objects in the response. Can be used as start for subsequent request. |
Params used for pagination
Name | Type | Description |
---|---|---|
limit | int | A limit on the number of objects to be returned.Default value : 10Allowed range : 10-100 |
start | object | Determines the starting point in the list of objects to be returned in the response. |