Foundation Data & Integrations
JSON REST API
5 min
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/ https //httpie io/ ) for all the examples rest methods get request retrieving records docid\ scdfmk8b0xoec3wpyjfql delete request deleting records docid\ rlebalyx emkszcdws4z4 post request creating new records docid 7r84suknw7 nv3upvd7bd put request replacing content of existing records docid\ pnwdzsdyhcqyyznoytacm patch request updating existing records docid\ nunvrgvruebtrorwxihle 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