jsonAction request
List of properties in JSON Action request messages
The following properties are part of each jsonAction request message. All are optional except for "action", and "params". APIs often take advantage of the optional properties to implement advanced features.
Example
{
"requestId": "1",
"api": "someApi",
"apiVersion": "1.0",
"action": "someAction",
"params": {},
"responseOptions":
{
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string",
"includeFields": [],
"excludeFields": [],
"includePaths": [],
"excludePaths": []
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Properties summary
Property | Description | Default | Type | Limits (inclusive) | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
contains the name of a remote procedure call that the server can execute. | Required - No default value | string | ||||||||
(optional) contains the name of an API. |
| string |
| |||||||
(optional) specifies the major, minor, and patch versions of the API. | Latest version of the API | string | 0 to 12 bytes | |||||||
signifies that the client is authenticated and authorized. | Required - No default value NoteOptional for | string | 0 to 225 bytes | |||||||
(optional) contains the settings for returning any extra debug information. |
| string |
| |||||||
(optional) contains the parameters to an action. |
| object | ||||||||
(optional) contains any JSON value to identify a message as assigned by the client. |
|
| ||||||||
(optional) configures the server to return a customized response. |
| object | ||||||||
| (optional) specifies how binary values are returned. |
| string | One of the following: | ||||||
| (optional) specifies what format the results will be returned in. |
| string |
| ||||||
| (optional) specifies which fields are excluded in the response message. |
NoteDefaults to the | array | |||||||
| (optional) specifies which fields are returned in the response message. |
NoteDefaults to include all fields. | array | |||||||
| (optional) specifies how numbers are formatted in the JSON response message. |
| string |
|
A JSON Action request message facilitates remote procedure calls to a server, with the "action" and "params" properties being mandatory. While other properties are optional, they enable advanced features, such as "responseOptions" for customizing the server's response format (e.g., "binaryFormat", "dataFormat", "numberFormat", and field inclusion/exclusion), "api" to specify the target API, "apiVersion" for versioning, "authToken" for authentication (required for most requests except session creation), "debug" for returning troubleshooting information, and "requestId" to uniquely identify messages. Notably, "binaryFormat" is unique as it influences both request and response formatting for binary data, supporting "base64", "hex", or "byteArray" representations, each with trade-offs in readability and payload size.
JSON Action API
JSON Action message format
JSON Action properties
JSON Action parameters
API request structure
Remote Procedure Call (RPC) JSON
request message properties
JSON Action request
JSON DB API
action property JSON
responseOptions JSON request
JSON API development
Backend API integration JSON
Data serialization JSON
handling binary data in JSON
customizing JSON responses
API debugging JSON
JSON request payload
How to build JSON Action request
The "action" property is a required, case-insensitive string enum. It is the name of a remote procedure call that the server can execute.
Possible values depend on the API being used; for a complete list of "actions" see: JSON action REST APIs
The "api" property is an optional, case-insensitive string enum that contains the name of an API. An API can execute one or more actions. It defaults to whatever API is being used.
"db"Note
For JSON DB API
"api"is always"db"."mq""hub""admin"
The server returns the entire version number in the "apiVersion" property for troubleshooting purposes.
"apiVersion"specifies the major, minor, and patch versions of an API.Examples include
"3","3.1", and"3.1.23".The number to the left of the decimal point is the major API version.
The middle number is the minor API version, which is required only when a patch number is included.
The rightmost number is an optional patch number.
The "authToken" property signifies that the client is authenticated and authorized by the server. It is required except in "pingSession" and "createSession". For "pingSession" and "createSession" it defaults to an empty string.
The server generates a unique authentication token in response to "createSession". Clients must include it in all subsequent requests. If the client does not supply a valid "authToken", the server returns error 12031.
You can create a permanent "authToken" by setting the "permanentSession" property to true when you create a session. A permanent "authToken" works like an API key and does not expire.
The "debug" property is an optional, case-insensitive string enum that causes the server to return debug information. The default value is "none" which is equivalent to omitting this property or similar to setting it to null.
Possible values:
"none""max"
Setting the
"debug"value to anything other than"none"causes the server to pretty-print the JSON that it generates in the response, making it easier to troubleshoot.Setting to
"max"causes the server to return a response that includes the maximum amount of debug information in the response, making it useful for troubleshooting live production data with minimal impact on server resources.Setting to
"none"causes no debug information to be returned, which is useful for production environments that are running well.
The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System limits for a comprehensive overview of property requirements and limitations.
The optional "requestId" property is typically a string or integer, but can contain any JSON value that is an identifier assigned by the client. The default value is null.
"requestId"can contain any JSON value, including:object
array
string
integer
Boolean
null
From the client's perspective,
"requestId"uniquely identifies a message. The server returns this identifier to the client in its response message, allowing a client to match a request to a response.It is particularly useful when a client runs JSON DB API over an asynchronous protocol, such as MQTT or WebSocket.
It can be omitted or set to a zero-length string when the client does not need it.
The "responseOptions" property is an optional object that configures the server to return a customized response.
None of these properties are required, but some are mutually exclusive:
"includeFields"and"excludeFields"are mutually exclusive.Use
"includeFields"or"excludeFields"to control which record fields are present in the data.
Use
"dataFormat"to control whether data comes back as an array of arrays or an array of objects.Use
"binaryFormat"to control how binary data is embedded in JSON strings.Use
"numberFormat"to control whether JSON numbers are rendered as digits or digits embedded in a string.
The "dataFormat" property is an optional, case-insensitive string enum. It defines the format of data being sent to the server. "autoDetect" is the default value.
Note
There are two different but similar versions of the "dataFormat" property. One version occurs in a request, and the other occurs in a response.
"arrays"specifies that the"sourceData"is an array of arrays, which is most efficient."objects"specifies that the"sourceData"is an array of objects. This is less efficient but is simpler to generate, read, and troubleshoot."autoDetect"instructs the server to automatically detect the format of the data in the"sourceData"property. This is the default.Omitted or set to
nulldefaults to"autoDetect",
The "excludeFields" property is an optional array that specifies the fields to exclude from the response message.
Note
When the array is empty or the property is not specified, the "includeFields" specification applies.
Example request
{
"action": "someAction",
"responseOptions":
{
"excludeFields": ["field1", "field2"]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "includeFields" property is an optional array that specifies the fields to include in the response message.
Note
When the array is empty or the property is not specified, all fields are returned.
Example request
{
"action": "someAction",
"responseOptions":
{
"includeFields": ["field1", "field2"]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}