API section
Scales
Scale weight and zeroing (zero or tare).
| POST | /api/v1/scales/{id}/zero | Zero the scale |
| GET | /api/v1/scales/{id}/weight | Weight on the scale |
Set zero or tare, as the scale protocol allows; no request body
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer int32 | device number from |
Idempotency-Keyrequired | header | string | |
Prefer | header | string |
Response 200 application/json
Fields · Operation
idstring uuidtypestringidempotencyKeystringresourcesarray of stringstatusstringvalues:QUEUEDRUNNINGSUCCEEDEDFAILEDUNKNOWNstagestringcreatedAtstring date-timestartedAtstring date-timefinishedAtstring date-timeresultany valueerrorOperationError3 fields · OperationError
codestringmessagestringdetailsany value
warningsarray of string
Errors — problem+json with a code field, see error codes.
Request example
curl
curl -X POST 'http://localhost:7790/api/v1/scales/1/zero' \
-H 'Idempotency-Key: $(uuidgen)' \
-H 'Prefer: wait=30'curl
curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/scales/1/zero' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Idempotency-Key: $(uuidgen)' \
-H 'Prefer: wait=30'Weight on the scale#
GET
/api/v1/scales/{id}/weightImmediate, not an operation: request-response scales wait a few seconds for the load to settle (stable=true). Stream-mode scales return the latest reading; its changes arrive as weight events
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer int32 | device number from |
Response 200 application/json
Fields · Weight
deviceIdinteger int32weightnumberstablebooleanatstring date-time
Errors — problem+json with a code field, see error codes.
Request example
curl
curl 'http://localhost:7790/api/v1/scales/1/weight'curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/scales/1/weight' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'