JSON REST API

JSON REST API

Servicely provides a comprehensive JSON REST API to facilitate integration and automation with external systems.

API Versions

Version 1: Initial version of the API. Accessed via [instance_base_url]/v1/

 

Authentication

The REST API currently supports Basic authentication (username/password) and Token authentication (Bearer Token).

 

Quick start

The linked examples use a command line tool called HTTPie (https://httpie.io/ ) for all the examples.

 

REST Methods

 

 

Batch REST API

REST calls can also be batched together to improve latency/performance, or just to logically group requests together.

Requires version 1.4.2-release.40

The format for the request is a simple JSON document that batches the required requests into an array. The “url” and “body” attributes match exactly to the URL and Body arguments that would normally be sent to the REST API.

Example request object format:

{ "id": "unique-batch-identifier-111", // A Batch identifier. Required. "requests": [ // An array of the requests to execute. Required. { "id": "1", // A correlation id so the response can be matched to the request. Required. "url": "/v1/User?fields=Name&page_size=1", // The URL as would be sent any other way. Required. "method": "GET", // Method for the request [GET, PUT, POST, PATCH, DELETE]. Required. "body": null // Optional body for requests that need a body - JSON encoded string. Optional. } ] }

Example response object:

{ "id": "unique-batch-identifier-111", // The batch identifier from the original request. "requests": [ { "body": "{\"data\":[{\"Name\":\"Kai Rowell\"}]}", // The response body "execution_time": 62, // The execution time "id": "1", // The correlation ID from the original request "status_code": 200, // The HTTP Status Code for the request "status_text": "OK" // The HTTP Status Text for the request } ] }

Batch API URL

Requests for the Batch API go to /v1/_batch

Screenshot

Example screenshot from a Postman request.

 

Related content

Servicely Documentation