HW agent API 2.15.3

API section

Emulators

Register, terminal, scale and printer emulators for debugging without hardware: response modes (out of paper, terminal declines).

PUT/api/v1/emulators/{number}Switch emulator mode
GET/api/v1/emulatorsEmulators and their response modes

Switch emulator mode#

PUT/api/v1/emulators/{number}

For example {"mode":"NO_PAPER"} — the register answers “out of paper”; {"mode":"DECLINED","once":true} — the terminal declines once; {"mode":"NORMAL"} — works again

Parameters

NameInTypeDescription
numberrequiredpathinteger int32

device number from GET /api/v1/devices

Request body application/json required

Fields · ModeRequest
  • modestring
  • onceboolean
JSON
{
  "mode": "string",
  "once": false
}

Response 200 application/json

Fields · EmulatorInfo
  • numberinteger int32
  • typestring
  • namestring
  • modeState
    3 fields · State
    • modestring
    • onceboolean
    • modesarray of Mode
      3 fields · Mode
      • idstring
      • titlestring
      • descriptionstring

Errors — problem+json with a code field, see error codes.

Request example

curl
curl -X PUT 'http://localhost:7790/api/v1/emulators/1' \
  -H 'Content-Type: application/json' \
  --data '{"mode":"string","once":false}'
curl
curl -X PUT 'https://cloud.hw-connector.ru/agent/api/v1/emulators/1' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42' \
  -H 'Content-Type: application/json' \
  --data '{"mode":"string","once":false}'

Emulators and their response modes#

GET/api/v1/emulators

Response 200 application/json

Array · EmulatorInfo
  • numberinteger int32
  • typestring
  • namestring
  • modeState
    3 fields · State
    • modestring
    • onceboolean
    • modesarray of Mode
      3 fields · Mode
      • idstring
      • titlestring
      • descriptionstring

Errors — problem+json with a code field, see error codes.

Request example

curl
curl 'http://localhost:7790/api/v1/emulators'
curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/emulators' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42'