Skip to main content

GPIO

Authentication: every request needs an IdToken — see Authentication. Errors follow the shared error format.

General-purpose outputs (GPOs) let a reader switch external devices such as stack lights, buzzers, or relays on and off. The number of GPOs depends on the reader model; see capabilities.totalGPOs in Get Device Settings Supports.

MethodPathPurpose
GET/devices/{deviceId}/details/gpo-settingsCurrent state of each GPO
POST/devices/{deviceId}/operations/gpo-settingsTurn GPOs on or off, optionally for a set time

Get GPO Settings​

Endpoint Details​

  • URL: https://rest.api.xemelgo.com/edge/devices/{deviceId}/details/gpo-settings
  • Method: GET

Query Parameters​

ParameterTypeDescriptionRequired
refreshStringtrue to ask the reader now. Omit to return the cached valueNo

StatusCode — 200 on success

Response Body​

GPO numbers mapped to their state, true for on:

{
"1": false,
"2": false,
"3": false,
"4": false
}

Set GPO Settings​

Turns GPOs on or off and returns the state now on the reader.

Endpoint Details​

  • URL: https://rest.api.xemelgo.com/edge/devices/{deviceId}/operations/gpo-settings
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
settingsObjectGPO numbers mapped to true (on) or false (off). GPOs not listed are left as they areYes
intervalSecNumberIf set, the GPOs in settings are set, held for this many seconds, then turned offNo

With intervalSec, the request returns after the interval has passed and the GPOs are turned off, so long intervals can make the request time out.

Request Body​

Turn GPO 1 on:

{
"settings": { "1": true }
}

Turn GPO 1 on for 3 seconds, then off:

{
"settings": { "1": true },
"intervalSec": 3
}

StatusCode — 200 on success

Response Body​

The GPO state now on the reader, in the same shape as Get GPO Settings.

Errors​

ReasonCause
Payload validation failed on field settings due to: field is requiredsettings is missing