Get dispenser
GET
{{server}}/api/v1/dispenser/deviceThis endpoint returns the dispenser entity based on the presented Websocket ID in the X-WSID header.
Request
Authorization
| Header | Value |
|---|---|
Authorization | Apikey {{dispenserApikey}} |
Headers
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{dispenserWsID}} |
Code snippets
- cURL
- JavaScript
- Python
curl -X GET '{{server}}/api/v1/dispenser/device' \
-H 'Accept: application/json' \
-H 'X-WSID: {{dispenserWsID}}' \
-H 'Authorization: Apikey {{dispenserApikey}}'
const response = await fetch("{{server}}/api/v1/dispenser/device", {
method: "GET",
headers: {
"Accept": "application/json",
"X-WSID": "{{dispenserWsID}}",
"Authorization": "Apikey {{dispenserApikey}}"
},
});
const data = await response.json();
console.log(data);
import requests
url = "{{server}}/api/v1/dispenser/device"
headers = {
"Accept": "application/json",
"X-WSID": "{{dispenserWsID}}",
"Authorization": "Apikey {{dispenserApikey}}"
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
Example
Example request
GET
{{server}}/api/v1/dispenser/deviceHeaders (2)
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{dispenserWsID}} |
Example response 200 Ok
Response headers (9)
| Key | Value |
|---|---|
Access-Control-Expose-Headers | * |
Cache-Control | no-store, no-cache, must-revalidate |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | POST, PUT, GET, OPTIONS, DELETE |
Access-Control-Allow-Credentials | true |
Content-Length | 1021 |
Access-Control-Max-Age | 86400 |
Access-Control-Allow-Headers | Content-Type, Authorization, X-Requested-With |
Content-Type | application/json;charset=utf-8 |
Body
{
"category": "dispenser",
"deviceType": 5,
"clientID": "0",
"deviceID": "5",
"special": {
"cardReaders": [],
"profiles": [
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 1,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 2,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 3,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 4,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 5,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 6,
"start": "0000",
"end": "2400",
"links": null
},
{
"profile": "00000000-0000-4000-0008-000000000001",
"day": 0,
"start": "0000",
"end": "2400",
"links": null
}
]
},
"status": 1,
"branch": "00000000-0000-4000-0003-000000000001",
"name": "Default Dispenser",
"websocketID": "default_dispenser",
"key": "196a9ca3-6cd4-498e-efaf-e3beeaad7b5b",
"type": 10,
"aspect": null,
"time": 1746605323983
}