Answer with error

Purpose

Execute a custom XML request at the cash register

Request typeasynchronous/synchronous
Supported agent versionv1, v2
PluggetSystemTypeRKMid

Request format


JSON

{
  "taskType": "ExecuteRk7Query",
  "params": {
    "async": {
      "objectId": number,
       "timeout": number
    },
    "sync": {
      "objectId": number,
       "timeout": number
    },
    "base64": "string"
  }
}

Parameter

Type

Mandatory

Description

taskTypestringyesThe task type. For this method the value is ExecuteRk7Query
-async

Asynchronous method call: either synchronous or asynchronous
-sync

Synchronous method call: either synchronous or asynchronous
--timeoutintnoAgent response timeout in seconds, default is 120 seconds
--objectIdintyesRestaurant code in the licensing system
-base64stringyes

The query text in xml is the entire RK7Query node, which must be converted to base64 encoding. For testing, this can be done using any online service.

In the White Server administrative panel, the request text will be displayed in both versions: the original and encoded in base64.

Example request:

Xml original text:

<?xml version="1.0" encoding="UTF-8"?>
  <RK7Query>
  <RK7CMD CMD="GetSystemInfo"/>
</RK7Query>


JSON


Xml in base64 encoding:

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxSSzdRdWVyeT4NCiAgCQk8Uks3Q01EIENNRD0iR2V0U3lzdGVtSW5mbyIvPg0KPC9SSzdRdWVyeT4NCg==


CODE

Response format


JSON

{
   "responseCommon":{
      "taskGuid":"guid",
      "taskType":"ExecuteRk7Query",
      "objectId": 0
   },
   "error":{
      "wsError":{
         "code":"string",
         "desc":"string"
      }
   }
}

Parameter

Type

Description

-taskGuidguidUnique code of this task, used when receiving a task through 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

Successful response:
JSON

{
  "taskResponse": {
     "base64": {
     }
  },
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "ExecuteRk7Query",
    "objectId": 0
  },
  "error": {
    "wsError": {
      "code": "string",
      "extCode": "string",
      "desc": "string"
    },
    "agentError": {
      "code": 0,
      "text": "string"
    }
  }
}



Error response:
JSON

{
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "Rk7Query",
    "objectId": 0
  },
  "error": {
    "wsError": {
      "code": "string",
      "desc": "string"
    },
    "agentError": {
      "code": 0,
      "desc": "string"
    }
  }
}

Parameter

Parameter type

Mandatory

Description

-base64stringyes

In the White Server administrative panel, the request text will be displayed in both versions: the original and encoded in base64.

Example answer:

Xml original text:
XML

<?xml version="1.0" encoding="UTF-8"?>
  <RK7QueryResult ServerVersion="7.6.2.203" XmlVersion="244" NetName="5826_MIDSERV" Status="Ok" CMD="GetSystemInfo" ErrorText="" DateTime="2019-10-01T15:14:28" WorkTime="0" Processed="1">
  <SystemInfo SystemTime="3779104468231" ReqSysVer="2" NetName="5826_MIDSERV" ProcessID="3052" CashServerVersion="7.6.2.203" ShiftDate="20190930" RestCode="199995826">
    <BusinessPeriod id="0" code="0" />
    <CashGroup id="15007" code="15007" name="5826_MIDSERV" />
    <Restaurant id="1" code="5826" name="Ресторан "Стенд"" />
  </SystemInfo>
</RK7QueryResult>


Xml in base64 encoding:

YXVyYW50IGlkPSIxIiBjb2RlPSI1ODI2IiBuYW1lPSLvv73vv73vv73vv73vv73vv73vv73vv70gJnF1b3Q777+977+977+977+977+9JnF1b3Q7IiAvPg0KICAgIDwvU3lzdGVtSW5mbz4NCjwvUks3UXVlcnlSZXN1bHQ+



errorstring enum
Error container, for more details see the article Error Description