GSD-RestApi FromEx macros
xRestApi_DeleteObject_HandlerFromEx
Macro allows to delete an object
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_DeleteObjects_HandlerFromEx
Macro allows to delete a set of objects
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetConversations_HandlerFromEx
Macro allows to get all the conversations from user incoming folder. By conversation it means a root messages from all conversations between users
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetDocs_HandlerFromEx
Macro allows to retriev a list of documents from specified path. It can be either a folder or object's document folder
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetExtModelDict_HandlerFromEx
Dictionary - assign values to fields or fields
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetExtModelML_HandlerFromEx
Macro allows to get translation for a class or for a field
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetExtModelStructure_HandlerFromEx
Macro allows to get a model of class / classes. If the classes queryParameter is empty the whole class structure is returned. With set baseClasses queryParameter class structure will be returned with only base classes. With set skipMembers queryParameter class structure will be returned without members
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetFile_HandlerFromEx
Macro allows to get a file out of a DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetIncidentTree_HandlerFromEx
Macro allows to get an incidents and/or its subincidents
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetMessages_HandlerFromEx
Macro allows to get a messages from DOCUframe. It can work in two ways. First (query type 0) it is retrieving all messages from incoming folder of user. Secondly (query type 1) it is getting whole conversations for specified (by query) messages
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
type |
INT |
IN |
Type of query. 0 - Incoming messages, 1 - Get conversation |
xRestApi_GetModelDict_HandlerFromEx
Dictionary - assign values to fields or fields
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetModelML_HandlerFromEx
Macro allows to get translation for a class or for a field
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetModelStructure_HandlerFromEx
Macro allows to get a model of class / classes. If the classes queryParameter is empty the whole class structure is returned. With set baseClasses queryParameter class structure will be returned with only base classes. With set skipMembers queryParameter class structure will be returned without members.
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetObject_HandlerFromEx
Macro allows to serialize an object
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetObjectField_HandlerFromEx
Macro allows to serialize only a specific fields of an object
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestAPI_GetObjectJsonSchema_HandlerFromEx
Macro allows to generate JSON Schema for an object
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetObjects_HandlerFromEx
Macro allows to serialize a set of objects
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestAPI_GetObjectsJsonSchema_HandlerFromEx
Macro allows to generate JSON Schema for an object set
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetRestApiMacros_HandlerFromEx
Macro allows to get a GSD-RestApi module interface macros
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_GetTempPath_HandlerFromEx
Macro allows to get a path to an application temporary folder
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PatchObject_HandlerFromEx
Macro allows to update an existing object in the DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PatchObjects_HandlerFromEx
Macro allows to update a set of existing objects in the DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PostAction_HandlerFromEx
Macro allows to
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PostMessage_HandlerFromEx
Macro allows to create a new message in the DOCUframe and send it to user(s)
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PostObject_HandlerImplFromEx
Macro allows to create a new object in the DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PostUpdate_HandlerFromEx
Macro allows to upload files to DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
xRestApi_PutUpdate_HandlerFromEx
Macro allows to upload multipage image to DOCUframe
Parameter |
Type |
Reference |
Description |
&req |
HJSON |
IN |
JSON Handle with a request sent from external device |
&res |
HJSON |
IN-OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
&output |
STRING |
OUT |
The same response from a DOCUframe as res: HJSON, but in STRING form |
mode |
INT |
IN |
Execution mode of macro (Normal, Request, Response, Error response) |
Response macros
xRestApi_BuilderResponseFromEx
Macro is used to build a proper JSON response that will be fully understandable by external applications. It guarantee that returned JSON will have a proper structure
Parameter |
Type |
Reference |
Description |
&res |
HJSON |
OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
httpStatus |
INT |
IN |
HTTP status code |
internalStatus |
STRING |
IN |
Internal status code |
statusMessage |
STRING |
IN |
Status message (eg informations about occurred error, or success informations like "ok", "accepted etc.) |
debugStatus |
STRING |
IN |
Status for debugging purpose only |
debugMessage |
STRING |
IN |
Status message for debugging purpose only |
data |
HJSON |
IN |
JSON handle that contains the data from whole request handling process (eg Creating an object, serializing messages etc.) |
Return type |
Description |
HJSON |
JSON Hanlde with a response from a DOCUframe |
Info
It is highly recommended to use this macro to build every request response
xRestApi_SetOutputFromJsonFromEx
Macro is used to build a proper response that will be fully understandable by external applications, but On the contrary to previous one, this time in STRING format. It guarantee that returned response will have a proper structure
Parameter |
Type |
Reference |
Description |
&res |
HJSON |
OUT |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
httpStatus |
INT |
IN |
HTTP status code |
internalStatus |
STRING |
IN |
Internal status code |
statusMessage |
STRING |
IN |
Status message (eg informations about occurred error, or success informations like "ok", "accepted etc.) |
debugStatus |
STRING |
IN |
Status for debugging purpose only |
debugMessage |
STRING |
IN |
Status message for debugging purpose only |
data |
HJSON |
IN |
JSON handle that contains the data from whole request handling process (eg Creating an object, serializing messages etc.) |
Return type |
Description |
STRING |
Response from DOCUframe |
Utils macros
STRING::xRestApi_ConvertISOTimeToTimeFromEx
Macro allows to convert request ISO time with timezone to TIME understandable for DOCUframe. ISO time should be exactly in given format: YYYYMMDDThhmmss([-+]hh:mm|Z)
Parameter |
Type |
Reference |
Description |
- |
- |
- |
- |
Return type |
Description |
TIME |
Proper DOCU frame time converted from ISO time |
TIME::xRestApi_ConvertTimeToISOTimeFromEx
Macro allows to convert DOCUframe time to ISO time with timezone. Time will be returned in given format: YYYYMMDDThhmmss([-+]hh:mm|Z)
Parameter |
Type |
Reference |
Default |
Description |
extended |
BOOL |
IN |
FALSE |
Formats the text as a short form (FALSE) or as a long form (TRUE) |
Return type |
Description |
STRING |
DOCUframe time converted to ISO time |
xRestApi_CheckObjectAccessFromEx
Macro allows to check access to an object, if OID was passed. In the other hand, if class was passed, it first checks access for class, then new object is created.
Parameter |
Type |
Reference |
Default |
Description |
oid |
STRING |
IN |
"" |
OID of an object. If passed, this object will be checked, if it is empty new object of given class will be created |
res |
HJSON |
OUT |
- |
JSON Hanlde with a response from a DOCUframe. It contains both, error reports (if any) and output data |
obj |
DBOBJECT |
OUT |
- |
Returned object |
accessCheck |
INT |
IN |
0 |
Number that represents user rights to the object |
class |
STRING |
IN |
"" |
Class name of the object. If passed and if there is no OID, new object of this class will be created |
writeResponse |
BOOL |
IN |
TRUE |
Indicates whether response (res) should be returned at this point, or not |
code |
INT |
OUT |
0 |
Internal status code |
httpStatus |
INT |
OUT |
0 |
HTTP status code |
message |
STRING |
OUT |
"" |
Status message (eg informations about occurred error, or success informations like "ok", "accepted etc.) |
Return type |
Description |
BOOL |
TRUE if everything went OK |
xRestApi_GetObjectFromJsonFromEx
Macro allows to retrive an object from a JSON handle
Parameter |
Type |
Reference |
Default |
Description |
json |
HJSON |
IN |
- |
JSON Handle with a request |
jsonMember |
STRING |
IN |
- |
Name of the JSON Handle member with an OID |
classNames |
STRING (array) |
IN |
- |
Class or list of classes whose type should be the object. If empty, any class is allowed |
resultObject |
DBOBJECT |
OUT |
- |
Returned object |
mandatory |
BOOL |
IN |
- |
Indicates whether object must exist or not |
httpStatus |
INT |
OUT |
- |
HTTP Status code |
debugMessage |
STRING |
OUT |
- |
Status message for debugging purpose only |
user |
User |
IN |
NULL |
If passed, user rights to this object for this user will be checked |
Return type |
Description |
STRING |
Internal status code |
Return possible values |
Description |
0 |
Object found |
1 |
Not mandatory and not transferred, the calling macro can use a default value |
-1 |
JSON Handle is empty |
-2 |
JSON Member not found |
-3 |
OID is empty |
-4 |
No object of given OID found |
-5 |
Found object is an object of different class |
-6 |
User has no Read-Right to the object |
xRestApi_GetValueFromJsonFromEx
Macro allows to retrive a value from a JSON Handle
Parameter |
Type |
Reference |
Description |
json |
HJSON |
IN |
JSON Handle with a request |
jsonMember |
STRING |
IN |
Name of the JSON Handle member with an OID |
type |
STRING |
IN |
Type of the value |
mandatory |
BOOL |
IN |
Indicates whether member must exist and must be filled or not |
debugMessage |
STRING |
OUT |
Status message for debugging purpose only |
result |
VariableValue |
OUT |
Returned object with the value in it |
Return type |
Description |
STRING |
Internal status code |
Return possible values |
Description |
0 |
Value is found and correct |
1 |
Not mandatory and not transferred, the calling macro can use a default value |
-1 |
JSON Handle is empty |
-2 |
JSON Member not found |
-4 |
Value is empty |
-5 |
Value has wrong datatype |
xRestApi_InitJsonHandlesFromEx
Macro allows to prepare a proper JSON Handle based on the input STRING
Parameter |
Type |
Reference |
Description |
input |
STRING |
IN |
JSON Handle with an input but in STRING format |
jsonInput |
HJSON |
OUT |
JSON Handle with an input |
jsonOutput |
HJSON |
OUT |
JSON Handle with an output |
output |
STRING |
OUT |
JSON Handle with an output but in STRING format |
exeMode |
INT |
IN |
Executionmode |
Return type |
Description |
BOOL |
TRUE when initialization went OK |