The create notification will create a new notification with the specified request body.
Request
Request URI
Method | Request URI |
---|---|
POST | https://{company-name}.helloid.com/api/v1/notifications/ |
Request parameters
Parameter | Description |
---|---|
{company-name} | The company name of the target company |
Request headers
Parameter | Description |
---|---|
Content-Type | Required. Must be set to application/json |
Sample Request body
{ "title": { "en": "New message", "nl": null, "de": "Translation", "fr": null }, "message": { "en": "Message description", "nl": null, "de": null, "fr": null }, "exposed": true, "icon": null, "type": 0, "level": 0, "visibleFromDate": "2018-01-30T13:48:25", "expireDate": null, "targetedGroups": [] }
Request body parameters
Parameter | Description | Required/Optional | Default Value |
---|---|---|---|
{Title} | The title of the notification. The English language is required. | Required | - |
{Message} | The message of the notification | Optional | - |
{Exposed} | Is the notification exposed to users | Optional | False |
{Icon} | Icon displayed next to the notification. One of the font awesome icons. | Optional | "fa-bell" |
{Type} | Type of the notification | Optional | 0 |
{Level} | Level of the notification | Optional | 0 |
{VisibleFromDate} | Timestamp of when the notification should be visible | Optional | Now |
{ExpireDate} | Timestamp of when the notification should no longer be visible | Optional | - |
{TargetedGroups} | List of GUIDs of all groups that should be able to see the notification. An empty list means all users can see the notification. | Optional | - |
Title and Message parameters
HelloID will provide a translation when provided. When the content for a language is empty or null the English language will be used.
Notification Type Descriptions
Number | Object Type |
---|---|
0 | Default, the notification is visible in both the notification center (globe) and the center bar until dismissed. |
1 | Center bar only, only displays the notification in the center bar until it is dismissed. |
2 | Notification center (globe) only, only displays the notification in the notification center. Does not disappear when dismissed. |
Notification Level Descriptions
Number | Object Type |
---|---|
0 | Default |
1 | Primary |
2 | Success |
3 | Info |
4 | Warning |
5 | Danger |
Check out https://getbootstrap.com/docs/3.3/css/#helper-classes-backgrounds for examples of each level.
Response
Response status
Code | Description |
---|---|
200(OK) | Indicates that the operation was successful. |
400(BAD REQUEST) | Indicates that the operation was not successful. There were validation errors or the request body was malformed. |
401(UNAUTHORIZED) | Indicates that no authentication header was given or the api key and secret were invalid. If the api key and secret were valid check the configuration in your portal, it is possibilty these were IP restricted or are disabled. |
Please also see error result.
Please also see common HTTP status codes.
Sample response body
{ "notificationGUID": "0a82f9e7-64d5-4b6e-bef0-d45caab22f1f", "title": { "en": "Welcome to the HelloID portal", "nl": "Welkom op het HelloID portal", "de": "", "fr": "" }, "message": { "en": "Check out you applications and products", "nl": "Bekijk je applicaties en producten", "de": "", "fr": "" }, "exposed": true, "icon": "fa-bell", "type": 0, "level": 0, "visibleFromDate": "2018-01-30T13:48:25", "expireDate": null, "targetedGroups": [] }
Example request with cURL
Replace placeholder values surrounded by { } with the actual values.
curl -u {api-key}:{api-secret} -X POST https://{company-name}.helloid.com/api/v1/notifications/ -H "Content-Type:application/json" -d "{ "title": { "en": "New message", "nl": null, "de": "Translation", "fr": null }, "message": { "en": "Message description", "nl": null, "de": null, "fr": null }, "exposed": true, "icon": null, "type": 0, "level": 0, "visibleFromDate": "2018-01-30T13:48:25", "expireDate": null, "targetedGroups": [] } "