Users
Users are critical for maintaining secure interactions between users and the system. Below are the different endpoints available to handle users programmatically.
The Users Model
A user is an entity that can be used to authenticate and interact with the system. You can create, fetch, and delete users using the following endpoints.
Scheme
- Name
id- Type
- integer
- Description
- The unique identifier for the user.
- Name
name- Type
- string
- Description
- The full name of the user.
- Name
email- Type
- string
- Description
- The email address of the user.
- Name
phone- Type
- string
- Description
- The phone number of the user.
- Name
readonly- Type
- boolean
- Description
- Whether the user is read-only.
- Name
administrator- Type
- boolean
- Description
- Whether the user is an administrator.
- Name
map- Type
- string
- Description
- The default map of the user.
- Name
latitude- Type
- number
- Description
- The default position's latitude presentation to the user
- Name
longitude- Type
- number
- Description
- The default position's longitude presentation to the user
- Name
zoom- Type
- integer
- Description
- The default zoom level presentation of the user.
- Name
password- Type
- string
- Description
- The password of the user.
- Name
coordinateFormat- Type
- string
- Description
- The format of the coordinate presentation of the user.
- Name
disabled- Type
- boolean
- Description
- Whether the user is disabled.
- Name
expirationTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
deviceLimit- Type
- integer
- Description
- The maximum number of devices the user can connect.
- Name
userLimit- Type
- integer
- Description
- The maximum number of users the user can connect.
- Name
deviceReadonly- Type
- boolean
- Description
- Whether the user is read-only on devices.
- Name
limitCommands- Type
- boolean
- Description
- Whether the user is limited to commands.
- Name
fixedEmail- Type
- boolean
- Description
- Whether the user's email is fixed.
- Name
poiLayer- Type
- string
- Description
- The layer of the user's POI.
- Name
attributes- Type
- object
- Description
- The attributes of the user.
Fetch a list of users
This endpoint allows you to retrieve a list of users.
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
userId- Type
- string
- Description
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
- Name
400- Type
- error
- Description
No Permission
Request
curl --location 'https://gw.onemap8.com/api/users?userId=%3Cstring%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
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": { }
}
Create a user
This endpoint allows you to create a user. Successful execution is subject to limits and permissions.
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
- The unique identifier for the user.
- Name
name- Type
- string
- Description
- The full name of the user.
- Name
email- Type
- string
- Description
- The email address of the user.
- Name
phone- Type
- string
- Description
- The phone number of the user.
- Name
readonly- Type
- boolean
- Description
- Whether the user is read-only.
- Name
administrator- Type
- boolean
- Description
- Whether the user is an administrator.
- Name
map- Type
- string
- Description
- The default map of the user.
- Name
latitude- Type
- number
- Description
- The default position's latitude presentation to the user
- Name
longitude- Type
- number
- Description
- The default position's longitude presentation to the user
- Name
zoom- Type
- integer
- Description
- The default zoom level presentation of the user.
- Name
password- Type
- string
- Description
- The password of the user.
- Name
coordinateFormat- Type
- string
- Description
- The format of the coordinate presentation of the user.
- Name
disabled- Type
- boolean
- Description
- Whether the user is disabled.
- Name
expirationTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
deviceLimit- Type
- integer
- Description
- The maximum number of devices the user can connect.
- Name
userLimit- Type
- integer
- Description
- The maximum number of users the user can connect.
- Name
deviceReadonly- Type
- boolean
- Description
- Whether the user is read-only on devices.
- Name
limitCommands- Type
- boolean
- Description
- Whether the user is limited to commands.
- Name
fixedEmail- Type
- boolean
- Description
- Whether the user's email is fixed.
- Name
poiLayer- Type
- string
- Description
- The layer of the user's POI.
- Name
attributes- Type
- object
- Description
- The attributes of the user.
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
- Name
400- Type
- error
- Description
Bad Request
- Name
401- Type
- error
- Description
Not authorized
Request
curl --location 'https://gw.onemap8.com/api/users' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"readonly": "<boolean>",
"administrator": "<boolean>",
"map": "<string>",
"latitude": "<number>",
"longitude": "<number>",
"zoom": "<integer>",
"password": "<string>",
"coordinateFormat": "<string>",
"disabled": "<boolean>",
"expirationTime": "<dateTime>",
"deviceLimit": "<integer>",
"userLimit": "<integer>",
"deviceReadonly": "<boolean>",
"limitCommands": "<boolean>",
"fixedEmail": "<boolean>",
"poiLayer": "<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": { }
}
Update a user
This endpoint allows you to update a user. Successful execution is subject to permissions.
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
- The unique identifier for the user.
- Name
name- Type
- string
- Description
- The full name of the user.
- Name
email- Type
- string
- Description
- The email address of the user.
- Name
phone- Type
- string
- Description
- The phone number of the user.
- Name
readonly- Type
- boolean
- Description
- Whether the user is read-only.
- Name
administrator- Type
- boolean
- Description
- Whether the user is an administrator.
- Name
map- Type
- string
- Description
- The default map of the user.
- Name
latitude- Type
- number
- Description
- The default position's latitude presentation to the user
- Name
longitude- Type
- number
- Description
- The default position's longitude presentation to the user
- Name
zoom- Type
- integer
- Description
- The default zoom level presentation of the user.
- Name
password- Type
- string
- Description
- The password of the user.
- Name
coordinateFormat- Type
- string
- Description
- The format of the coordinate presentation of the user.
- Name
disabled- Type
- boolean
- Description
- Whether the user is disabled.
- Name
expirationTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
deviceLimit- Type
- integer
- Description
- The maximum number of devices the user can connect.
- Name
userLimit- Type
- integer
- Description
- The maximum number of users the user can connect.
- Name
deviceReadonly- Type
- boolean
- Description
- Whether the user is read-only on devices.
- Name
limitCommands- Type
- boolean
- Description
- Whether the user is limited to commands.
- Name
fixedEmail- Type
- boolean
- Description
- Whether the user's email is fixed.
- Name
poiLayer- Type
- string
- Description
- The layer of the user's POI.
- Name
attributes- Type
- object
- Description
- The attributes of the user.
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
- Name
400- Type
- error
- Description
Bad Request
- Name
401- Type
- error
- Description
Not authorized
Request
curl --location --request PUT 'https://gw.onemap8.com/api/users/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"readonly": "<boolean>",
"administrator": "<boolean>",
"map": "<string>",
"latitude": "<number>",
"longitude": "<number>",
"zoom": "<integer>",
"password": "<string>",
"coordinateFormat": "<string>",
"disabled": "<boolean>",
"expirationTime": "<dateTime>",
"deviceLimit": "<integer>",
"userLimit": "<integer>",
"deviceReadonly": "<boolean>",
"limitCommands": "<boolean>",
"fixedEmail": "<boolean>",
"poiLayer": "<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 user
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/users/<integer>' \
--header 'Authorization: Basic {your_access_token}'
Response
No content