HW agent API 2.15.3

API section

Agent

The agent is running, its version and power state; the device list; language; build branding.

GET/api/v1/languageAgent interface language
GET/api/v1/healthThe agent is running
GET/api/v1/devicesWorkplace devices
GET/api/v1/brandingBuild branding
GET/api/v1/branding/iconBrand icon

Agent interface language#

GET/api/v1/language

ru or en

Response 200 application/json

Type: map → string

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

Request example

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

The agent is running#

GET/api/v1/health

Version, start time, power; the client checks that the agent is installed

Response 200 application/json

Fields · AgentInfo
  • statusstring
  • versionstring
  • startedAtstring date-time
  • powerPower
    5 fields · Power
    • sourcestring
      values: AC BATTERY UNKNOWN
    • batteryboolean
    • batteryPercentinteger int32
    • minutesLeftinteger int32
    • atstring date-time

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

Request example

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

Workplace devices#

GET/api/v1/devices

Response 200 application/json

Array · DeviceInfo
  • idinteger int32
  • kindstring
    values: FISCAL_REGISTER PAYMENT_TERMINAL BARCODE_SCANNER PRINTER CASH_DRAWER CUSTOMER_DISPLAY CARD_READER CHANNEL SCALE
  • typestring
  • namestring
  • activeboolean
  • infomap → any value

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

Request example

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

Build branding#

GET/api/v1/branding

Product name, vendor, support, color; the standard build is “HW agent”

Response 200 application/json

Fields · Info
  • productNamestring
  • vendorstring
  • supportEmailstring
  • supportUrlstring
  • accentColorstring
  • customIconboolean

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

Request example

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

Brand icon#

GET/api/v1/branding/icon

PNG; 404 for the standard build

Response 200

File.

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

Request example

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