Notifications
User notifications management.
The Notifications Model
A notification is represented by the following schema:
Scheme
- Name
id- Type
- integer
- Description
- Name
type- Type
- string
- Description
- Name
always- Type
- boolean
- Description
- Name
web- Type
- boolean
- Description
- Name
mail- Type
- boolean
- Description
- Name
sms- Type
- boolean
- Description
- Name
calendarId- Type
- integer
- Description
- Name
attributes- Type
- object
- Description
Notification type is represented by the following schema:
Scheme
- Name
type- Type
- string
- Description
GET/notifications
Retrieve a list of notifications
Without any params, returns a list of notifications the user has access to
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 objects.
- Name
userId- Type
- integer
- Description
- Standard users can use this only with their own
userId
- Name
deviceId- Type
- integer
- Description
- Standard users can use this only with
deviceIds they have access to
- Name
groupId- Type
- integer
- Description
- Standard users can use this only with
groupIds they have access to
- Name
refresh- Type
- boolean
- Description
- Name
limit- Type
- integer
- Description
- Limit the number of returned results
- Name
offset- Type
- integer
- Description
- Offset for pagination
- Name
keyword- Type
- string
- Description
- Search keyword filter
Responses
- Name
200- Type
- success
- Description
- Name
application/json- Type
- response schema
- Description
Arrayof Notification
Request
GET
/notificationscurl --location 'https://gw.onemap8.com/api/notifications?all=%3Cboolean%3E&userId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&refresh=%3Cboolean%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
[
{
"id": 0,
"type": "string",
"always": true,
"web": true,
"mail": true,
"sms": true,
"calendarId": 0,
"attributes": { }
},
{
...
}
]
POST/notifications
Create a notification
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
type- Type
- string
- Description
- Name
always- Type
- boolean
- Description
- Name
web- Type
- boolean
- Description
- Name
mail- Type
- boolean
- Description
- Name
sms- Type
- boolean
- Description
- Name
calendarId- Type
- integer
- Description
- Name
attributes- Type
- object
- Description
Responses
- Name
200- Type
- success
- Description
- Name
application/json- Type
- response schema
- Description
Request
POST
/notificationscurl --location 'https://gw.onemap8.com/api/notifications' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"type": "<string>",
"always": "<boolean>",
"web": "<boolean>",
"mail": "<boolean>",
"sms": "<boolean>",
"calendarId": "<integer>",
"attributes": {}
}'
Response
{
"id": 0,
"type": "string",
"always": true,
"web": true,
"mail": true,
"sms": true,
"calendarId": 0,
"attributes": { }
}
PUT/notifications/{id}
Update a notification
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
type- Type
- string
- Description
- Name
always- Type
- boolean
- Description
- Name
web- Type
- boolean
- Description
- Name
mail- Type
- boolean
- Description
- Name
sms- Type
- boolean
- Description
- Name
calendarId- Type
- integer
- Description
- Name
attributes- Type
- object
- Description
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
application/json- Type
- response schema
- Description
- Name
200- Type
- success
- Description
- Notification
Request
PUT
/notifications/{id}curl --location --request PUT 'https://gw.onemap8.com/api/notifications/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"type": "<string>",
"always": "<boolean>",
"web": "<boolean>",
"mail": "<boolean>",
"sms": "<boolean>",
"calendarId": "<integer>",
"attributes": {}
}'
Response
{
"id": 0,
"type": "string",
"always": true,
"web": true,
"mail": true,
"sms": true,
"calendarId": 0,
"attributes": {}
}
DELETE/notifications/{id}
Delete a notification
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 required
- Description
Responses
- Name
204- Type
- success
- Description
- No content
Request
DELETE
/notifications/{id}curl --location --request DELETE 'https://gw.onemap8.com/api/notifications/<integer>' \
--header 'Authorization: Basic {your_access_token}'
Response
No content
GET/notifications/types
Retrieve a list of available Notification types
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
- HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
- HTTP Authorization Scheme: bearer
Responses
- Name
200- Type
- success
- Description
- Name
application/json- Type
- response schema
- Description
Arrayof Notification types
Request
GET
/notifications/typescurl --location 'https://gw.onemap8.com/api/notifications/types' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
[
{
"type": "string"
},
{
...
}
]
POST/notifications/test
Send test Notification to current user vía email or sms
Authorizations
BasicAuth or ApiKey
- Name
BasicAuth- Type
- scheme
- Description
- HTTP Authorization Scheme: basic
- Name
ApiKey- Type
- scheme
- Description
- HTTP Authorization Scheme: bearer
Responses
- Name
204- Type
- success
- Description
- Successful sending
- Name
400- Type
- success
- Description
- Sending has failed
Request
POST
/notificationscurl --location --request POST 'https://gw.onemap8.com/api/notifications/test' \
--header 'Authorization: Basic {your_access_token}'
Response
Successful sending
POST/notifications/send/{notificator}
Send a custom notification to selected users
Send a custom notification to selected users using the specified notificator.
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
notificator- Type
- string required
- Description
- Notificator type (e.g., mail, sms, web)
Query Parameters
- Name
userId- Type
- array of integer
- Description
- Optional list of user ids to send the notification to; if omitted, sends to all permitted users
Request body schema
- Name
application/json- Type
- schema
- Description
- NotificationMessage
Body schema
- Name
subject- Type
- string
- Description
- Subject or title of the notification
- Name
digest- Type
- string
- Description
- Short summary shown in compact contexts
- Name
body- Type
- string
- Description
- Full notification text (required)
- Name
priority- Type
- boolean
- Description
- Whether the message should be treated as high priority
Responses
- Name
204- Type
- success
- Description
- Successful sending
- Name
400- Type
- error
- Description
- Could happen if sending has failed
Request
POST
/notifications/send/{notificator}curl --location 'https://gw.onemap8.com/api/notifications/send/mail?userId=1&userId=2' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"subject": "System Alert",
"body": "This is a test notification",
"priority": true
}'
Response
Successful sending
GET/notifications/{id}
Fetch a Notification
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 required
- Description
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
- Notification
- Name
401- Type
- error
- Description
- Unauthorized
- Name
404- Type
- error
- Description
- Not found
Request
GET
/notifications/{id}curl --location 'https://gw.onemap8.com/api/notifications/<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
{
"id": 0,
"type": "<string>",
"description": "<string>",
"always": true,
"commandId": 0,
"notificators": "<string>",
"calendarId": 0,
"attributes": {}
}
GET/notifications/notificators
Fetch a list of available Notificators
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
announcement- Type
- boolean
- Description
- When `true`, exclude notificators that cannot deliver announcements
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
- NotificationType
- Name
401- Type
- error
- Description
- Unauthorized
Request
GET
/notifications/notificatorscurl --location 'https://gw.onemap8.com/api/notifications/notificators?announcement=<boolean>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
[
{
"type": "<string>"
}
]
POST/notifications/test/{notificator}
Send a test notification to the current User using the specified notificator
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
notificator- Type
- string required
- Description
Responses
- Name
204- Type
- success
- Description
- Successful sending
- Name
400- Type
- error
- Description
- Could happen if sending has failed
Request
POST
/notifications/test/{notificator}curl --location --request POST 'https://gw.onemap8.com/api/notifications/test/<string>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'
Response
Successful sending