Data types
When working with APIs, ELMA365 sends a request to a third-party service and receives a response containing the requested data. APIs work with the following data types:
String
JSON string data type
Example:
{
"key": "example"
}
Number
JSON number data type
Example:
{
"key": 10
}
Yes/No switch
JSON boolean data type
Example:
{
"key": true
}
Date/Time
JSON string data type
RFC3339 format
Example:
{
"key": "2006-01-02T15:04:05Z07:00"
}
Category
JSON objects array data type
Object fields:
- code: category code (string)
- name: category name (string)
Example:
{
"key": [ { "code": "example", "name": "Example"} ]
}
Money
JSON object data type
Object fields:
- cents: a value in a minimum coin (cent, euro cent, kopeck) (number)
- currency: the currency (string)
Example:
{
"cents": 1000,
"currency": "RUB"
}
Phone number
JSON objects array data type
Object fields:
- type: phone number type (string)
- tel: phone number (only ten-digit numbers) (string)
Example:
{
"key": [ { "type":"home", "tel":"+190000000000" } ]
}
Email address
JSON objects array data type
Object fields:
- type: email type (string)
- email: email address (only significant characters) (string)
Example:
{
"key": [ { "type":"home", "email":"example@email.com" } ]
}
Image
JSON strings array data type
Values are image files IDs in the system
Example:
{
"key": [ "c44b66f6-216a-457e-a37e-ea8e373a4b77" ]
}
Files
JSON strings array data type
Values are files’ IDs in the system
Example:
{
"key": [ "c44b66f6-216a-457e-a37e-ea8e373a4b77" ]
}
Full Name
JSON object data type
Object fields:
- lastname: last name
- firstname: first name
- middlename: middle name
Example:
{
"key": {
"lastname": "Smith",
"firstname": "Sara",
"middlename": "Ellen"
}
}
Link
JSON string data type
Example:
{
"key": "http://site.org"
}
Users
JSON strings array data type
Values are users IDs
Example:
{
"key": [ "c44b66f6-216a-457e-a37e-ea8e373a4b77" ]
}
App
JSON strings array data type
Values are app items IDs
Example:
{
"key": [ "c44b66f6-216a-457e-a37e-ea8e373a4b77" ]
}
Table
JSON object data type
Object fields:
- rows: strings array. Each string is an object whose fields are determined when configuring the table. Keys are the field codes whose values depend on their type. If the column value is specified by a formula, it is calculated automatically.
- result: this is the result object whose fields are defined when configuring the table. Only columns for which the result (value in the footer) is calculated by a formula will be included into this object. This object is calculated automatically based on the column settings.
- view: this is the string representation of the table formed by a template. The view is generated automatically.
Example:
{
"key" : {
"rows": [
{ "good_name" : "product 1", "count" : 10},
{ "good_name" : "product 2", "count" : 20},
],
"result": { "count": 30 },
"view": "Total: 30 items"
}
}