Purpose

Sending a command to the Agent plugin

Request typeAsynchronous/synchronous
Supported agent versionv2
PluggetSystemTypePlugin

Request format


JSON

{
    "taskType": "RunPluginCommand",
    "params": {
      "async": {
        "objectId": number,
         "timeout": number
      },
      "sync": {
        "objectId": number,
         "timeout": number
      },
        "pluginName": "string",
        "pluginParams": object
    }
}

Parameter

Type

Mandatory

Description

taskTypestringyesTask type, for this method the value is RunPluginCommand
-async

Asynchronous method call: either synchronous or asynchronous
-sync

Synchronous method call: either synchronous or asynchronous
--timeoutintnoAgent response time in seconds. Default is 120 seconds
--objectIdintyesRestaurant code in the licensing system
pluginNamestringyesThe name of the plugin the command is addressed to
pluginParamsobjectyesJson object that is passed to the plugin without parsing at the Agent level

Synchronous Response Format


JSON

{
   "responseCommon":{
      "taskGuid":"guid",
      "taskType":"RunPluginCommand",
      "objectId":number
   },
   "error":{
      "wsError":{
         "code":"string",
         "desc":"string"
      }
   }
}

Parameter

Type

Description

Parameter

Type

Description

-taskGuidguidUnique code for this task. Used when receiving a task via the queue
-taskTypestring enumTask type
-objectIdintRestaurant code in the licensing system
error
Error container, for more details see the article Error Description

Asynchronous response format


JSON

{
    "taskResponse": object,
    "responseCommon": {
        "taskGuid": "guid",
        "taskType": "RunPluginCommand",
        "objectId": "number"
    },
    "error": {
        "wsError": {
            "code": "string",
            "desc": "string"
        },
        "agentError": {
            "code": "string",
            "desc": "string"
        }
    }
}

Parameter

Parameter type

Description

taskResponseobjectJson serialized from the result of processing the command by the plugin
error
Error container, for more details see the article Error Description