API and SDK / Data types

Data types

When working with API, ELMA365 sends a request to a third-party service and receives a response containing the requested data. The API operates 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 (kopeck, cent, euro cent) (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»:«+790000000000» } ]
}

Email address

JSON objects array data type

Object fields:

type. Email type (string)

email. Email address (only significant symbols) (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. 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»
    }  
}

 

Found a typo? Highlight the text, press ctrl + enter and notify us