Use JSON-format to send and receive

This sections describes the JSON-format command strings that are used in the criAcApiClient_Call function and the criAcApiClient_GetResponseBuffer function.

Use JSON-format to send

The JSON-format used for sending is the object whose key is "request" in the first hierarchy.
The following value is specified in the "request" object:

Key Value Note
"version""1.0.0" Currently fix at "1.0.0"
"module""project", "preview", "build", "debug" or "error" Specifies the module name corresponding to the function
"function"Function name

If the function requires arguments, creates an object with "arguments" key and specifies the key and value for that object.
All argument values are specified in string format.

For example, the create_aisac_graph function written with JSON-format command string is as follows:

{
"request": {
"version": "1.0.0",
"module": "project",
"function": "create_aisac_graph",
"arguments": {
"aisac": "f7ff7a55-03c4-43d0-bc4d-d6723873b7d1",
"graph_type": "Volume"
}
}
}

The sample is displayed with indentation for easy viewing, but indentation is not necessary when actually sending.
In other words, the following string acts the same when sending:

{"request":{"version":"1.0.0","module":"project","function":"create_aisac_graph","arguments":{"aisac":"f7ff7a55-03c4-43d0-bc4d-d6723873b7d1","graph_type":"Volume"}}}


Use JSON-format to receive

The JSON-format used for sending is the object whose key is "response" in the first hierarchy.
The following value is specified in the "response" object:

Key Value Note
"version""1.0.0" Currently fix at "1.0.0"
"module""project", "preview", "build", "debug" or "error" Module name corresponding to the function
"function"Function name
"status""success" or "error"
"message"Error message None if empty
"data"Return value of function None if empty

The "message" key value is included if the "status" key value is "error" .
The "data" key value is included if the function has a return value.

For example, the character string obtained by receiving the execution result of the create_aisac_graph function with the criAcApiClient_GetResponseBuffer function will be in the following JSON format.

{
"response": {
"version": "1.0.0",
"module": "project",
"function": "create_aisac_graph",
"status": "success",
"message": "",
"data": "4e6e17fe-f763-45d7-b72d-eafae4af6d10"
}
}

The sample is displayed with indentation for easy viewing, but indentation is not necessary when actually receiving.
In other words, the following string acts the same when receiving:

{"response":{"version":"1.0.0","module":"project","function":"create_aisac_graph","status":"success","message":"","data":"4e6e17fe-f763-45d7-b72d-eafae4af6d10"}}


Character encoding for JSON data

JSON data received by CRI Atom CRI Atom Craft through the CRI Atom Craft Robot is processed as "**UTF-8**".
If you are sending or receiving JSON data from another programming language, you must use UTF-8 encoded text.