Rest API definition
Response definition
The API supports ONLY REST services that return the type application/json .
The default ContentType with which we send requests to the service is application/json. Also supported is multipart/form-data, if the header contains the parameter {'Content-Type': 'multipart/form-data'}. For example:
api.rest.v1.get('serviceId', {queryParams: {'key': 'value'}}, {'Content-Type': 'multipart/form-data'});The response from the service looks as follows:
{
status: {
code: int,
message: String
},
headers: Map<String, String>,
body: Map<String, Object>
}All elements in the response are processed as native variables in JavaScript. They can be accessed, for example, like this:
response.status.code // <--- obtaining the value from the `code` field, containing the response code, e.g. 200
response.status.message // <--- obtaining the value from the `message` field, containing the response message, e.g. "Accepted"
response.headers.language // <--- obtaining the value of the return header named `language`
response.body.user.type // <--- obtaining the value of a specific field from the response, where the response looks like: {"user": {"type": "userType"}}Exception definition
In the case of a return code other than 2XX we will get a catchable exception. For example in a situation with code 404 (service unavailable or incorrect address), code 405 (invalid method) or code 500 (internal server error on the service side).
The exception looks like this:
To verify whether this is an exception to handle ourselves, we can check if the caught item has the fields we are interested in.
Request definition
A request can be parameterized.
Requests can contain a payload:
And they can be without a payload:
Below is the definition of parameters:
The PATH definition looks as follows:
The TIMEOUTS definition looks as follows:
No TIMEOUTS
At the moment when the object TIMEOUTS is not defined for the executed REST request, values taken from the configuration will be assigned. They are located in the parameters:
<config>
<eximee> <restclient> <connection-timeout> <default>1000</default> <maximum>10000</maximum> </connection-timeout> <read-timeout> <default>10000</default> <maximum>30000</maximum> </read-timeout> </restclient> </eximee>
</config>
Parameter:
default specifies the value pulled when the object TIMEOUTS is not defined
maximum specifies the maximum value that a LOW-CODE Developer can set while preparing the request (if they set a value greater than the given one, the value maximum)
Example request executions are shown in the sections below.
Requests
For each of the requests below we assume a consistent configuration:
GET
Request without payload.
Examples:
And an example ScriptService:
DELETE
Request without payload.
Examples:
And an example ScriptService:
POST
Request with payload.
Examples:
And an example ScriptService:
PUT
Request with payload.
Examples:
And an example ScriptService:
PATCH
Request with payload.
Examples:
And an example ScriptService:
Eximee Designer
API hints have been provided in Eximee Designer.



And hints of possible serviceIds to use at the current moment. In case of a problem fetching the current list of serviceIds, the editor continues to operate, but does not provide information about any serviceId.


API testing (Postman)
Postman is a tool for testing and working with APIs that allows you to easily send HTTP requests (e.g. GET, POST) and analyze server responses. (https://www.postman.com/)
Last updated
Was this helpful?
