Devices
The main artifact of the system is the device. A device is a physical or virtual entity that can be tracked, monitored and controlled.
Devices are managed by the system and can be assigned to users and groups.
The Devices Model
A devices is represented by the following schema:
Scheme
- Name
id- Type
- integer
- Description
- Name
name- Type
- string
- Description
- Name
uniqueId- Type
- string
- Description
- Name
status- Type
- string
- Description
- Name
disabled- Type
- boolean
- Description
- Name
lastUpdate- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
positionId- Type
- integer
- Description
- Name
groupId- Type
- integer
- Description
- Name
phone- Type
- string
- Description
- Name
model- Type
- string
- Description
- Name
contact- Type
- string
- Description
- Name
category- Type
- string
- Description
- Name
attributes- Type
- object
- Description
Retrieve devices information
Without any params, returns a list of the user's devices
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Query Parameters
- Name
all- Type
- boolean
- Description
Can only be used by administrators or managers to retrieve all
Deviceobjects.
- Name
userId- Type
- integer
- Description
Standard users can use this only with their own userId
- Name
id- Type
- integer
- Description
To fetch one or more devices. Multiple params can be passed like
id=1&id=2
- Name
uniqueId- Type
- string
- Description
To fetch one or more devices. Multiple params can be passed like
uniqueId=1&uniqueId=2
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
Arrayof Device
- Name
400- Type
- error
- Description
Not permission
Request
curl --location 'https://gw.onemap8.com/api/devices?all=<boolean>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
[
{
"id": 0,
"name": "string",
"uniqueId": "string",
"status": "string",
"disabled": true,
"lastUpdate": "2019-08-24T14:15:22Z",
"positionId": 0,
"groupId": 0,
"phone": "string",
"model": "string",
"contact": "string",
"category": "string",
"attributes": { }
},
{
...
}
]
Create a device
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Request body schema
- Name
application/json- Type
- schema
- Description
Body schema
- Name
id- Type
- integer
- Description
- Name
name- Type
- string
- Description
- Name
uniqueId- Type
- string
- Description
- Name
status- Type
- string
- Description
- Name
disabled- Type
- boolean
- Description
- Name
lastUpdate- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
positionId- Type
- integer
- Description
- Name
groupId- Type
- integer
- Description
- Name
phone- Type
- string
- Description
- Name
model- Type
- string
- Description
- Name
contact- Type
- string
- Description
- Name
category- Type
- string
- Description
- Name
attributes- Type
- object
- Description
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
Request
curl --location 'https://gw.onemap8.com/api/devices' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"uniqueId": "<string>",
"status": "<string>",
"disabled": "<boolean>",
"lastUpdate": "<dateTime>",
"positionId": "<integer>",
"groupId": "<integer>",
"phone": "<string>",
"model": "<string>",
"contact": "<string>",
"category": "<string>",
"attributes": {}
}'
Response
{
"id": 0,
"name": "string",
"uniqueId": "string",
"status": "string",
"disabled": true,
"lastUpdate": "2019-08-24T14:15:22Z",
"positionId": 0,
"groupId": 0,
"phone": "string",
"model": "string",
"contact": "string",
"category": "string",
"attributes": { }
}
Update a device
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Path parameters
- Name
id- Type
- integer
- Description
required
Request body schema
- Name
application/json- Type
- schema
- Description
Body schema
- Name
id- Type
- integer
- Description
- Name
name- Type
- string
- Description
- Name
uniqueId- Type
- string
- Description
- Name
status- Type
- string
- Description
- Name
disabled- Type
- boolean
- Description
- Name
lastUpdate- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
positionId- Type
- integer
- Description
- Name
groupId- Type
- integer
- Description
- Name
phone- Type
- string
- Description
- Name
model- Type
- string
- Description
- Name
contact- Type
- string
- Description
- Name
category- Type
- string
- Description
- Name
attributes- Type
- object
- Description
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
Request
curl --location --request PUT 'https://gw.onemap8.com/api/devices/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"uniqueId": "<string>",
"status": "<string>",
"disabled": "<boolean>",
"lastUpdate": "<dateTime>",
"positionId": "<integer>",
"groupId": "<integer>",
"phone": "<string>",
"model": "<string>",
"contact": "<string>",
"category": "<string>",
"attributes": {}
}'
Response
{
"id": 0,
"name": "string",
"email": "string",
"phone": "string",
"readonly": true,
"administrator": true,
"map": "string",
"latitude": 0,
"longitude": 0,
"zoom": 0,
"password": "string",
"coordinateFormat": "string",
"disabled": true,
"expirationTime": "2019-08-24T14:15:22Z",
"deviceLimit": 0,
"userLimit": 0,
"deviceReadonly": true,
"limitCommands": true,
"fixedEmail": true,
"poiLayer": "string",
"attributes": { }
}
Delete a device
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
HTTP Authorization Scheme: bearer
Path parameters
- Name
id- Type
- integer
- Description
required
Responses
- Name
204- Type
- success
- Description
No content
Request
curl --location --request DELETE 'https://gw.onemap8.com/api/devices/<integer>' \
--header 'Authorization: Basic {your_access_token}'
Response
No content