Link Search Menu Expand Document

JSON REST APIs

Except for Kodika Server, you can also connect to any JSON REST API server. JSON is strict about the data types that can support, so we allow only a subset of the Suggested data types to be used in API requests and API responses. You can also create Models to support more complicated data types, which Kodika will automatically convert to JSON objects and arrays.

Text

Text (or string) is the data type that describes a combination of characters.

Int

Int includes all numbers with are not decimal, meaning all integers. Int is a subset of number data type.
Note: 3 and -3 are valid values for Int data type, but 3.13 is not. Suppose you try to assign a non-integer. In that case, Kodika will convert it to an integer by deleting everything after the decimal separator and not by rounding the number. For example, both 3.13 and 3.89 will be converted to 3.

Number

Number data type includes all decimal and integers, which means all valid numbers.
Tip: 3, 3.13, -3, 0, -4.99 are valid values for the Number data type.

True/False Bool

The Bool (or boolean) data type can have only two values: True(YES) or False(NO). The True/False Bool data type is used to check whether a condition is met or not.
Tip: True/False Bool data types can be used in IF Code Blocks.

Image

The Image data type represents an Image.
When Image is used as an API Request parameter, the request will be automatically converted to a multipart form, and img/png mime-type will be assigned to this parameter.
When Image is used as an API Response parameter, it will be automatically converted from data to Image.
Note: You should not confuse this data type with the Image Asset or the Server Image. You can get the image from an Image Asset or a Server Image but are not the same data type. Check out also Image Asset vs Server Image vs Image.