Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Swagger API documentation is always up-to-date and lets you try out any query with your user session or an API-key.

Introduction

The Notification Service allows the user to manage some notification settings.

It also exposes endpoints for mobile devices to register/unregister for push notifications.

The user notification settings endpoints are intended for users to use directly, mostly from the user preference page.

Notification settings

Currently, the notification settings endpoints provide notification settings for the mobile app.

Over time, more notification settings endpoints will be added here.

Fetch case notification settings

The /notifications/v1/settings/case endpoint returns case notification settings for the current user.
Currently, it only contains app notification settings.

Code Block
curl -X GET -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/notifications/v1/settings/case

This returns case notification settings, currently only for the mobile app.

Code Block
{
  ...
  "data": {
    ...
    "appSettings": {
      "verbose": true,
      "priority": [
        "medium","high"
      ]
    }
  }
}

You can check the swagger documentation for a more detailed description of the endpoint and the values that can be used in the Json object.

Update case notification settings for mobile

The /notifications/v1/settings/case/app endpoint allows the current user to change notification settings for the mobile app:

Code Block
curl -X PUT -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/notifications/v1/settings/case/app -d'
{
  "verbose": true,
  "priority": [
    "high"
  ]
}'

The result from this endpoint is the same structure as when fetching settings using the endpoint above.

You can check the swagger documentation for a more detailed description of the endpoint and the values that can be used in the Json object.

Notification Devices

A notification device is an iPhone or Android mobile with the Argus Mobile app installed.
The endpoints under /notifications/v1/device provide a way for a device to bind/unbind a user to a device for push notifications.

These endpoints are mostly intended for use by the mobile app, but can also be used to list/remove devices from the current user.

Register new device

To bind a new device to the current user, the device must first connect to Google Firebase and retrieve a device token.
Then the device must register the token to the current user

List registered devices

List registered devices on the current user:

Code Block
curl -X POSTGET -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/notifications/v1/device -d '{
  


This returns a list of devices:

Code Block
{
  ...
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "type": "iphone",
      "name": "My iPhone",
      "tokenflags": "68b21e23726b63ed91621968760869e3" []
    }
  ]
}'

You can check the swagger documentation for a more detailed description of the endpoint and the values that can be used in the Json object.

List registered devices

List registered devices on

Register new device

To bind a new device to the current user, the device must first connect to Google Firebase and retrieve a device token.
Then the device must register the token to the current user:

Code Block
curl -X GETPOST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/notifications/v1/device

This returns a list of devices:

Code Block
{
  ...
  "data": [
     -d '{
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "type": "iphone",
      "name": "My iPhone",
      "flagstoken": []
    }
  ]
}"68b21e23726b63ed91621968760869e3"
}'

The result from this endpoint is the same datamodel as returned when listing registered devices above.

You can check the swagger documentation for a more detailed description of the endpoint and the values that can be used in the Json object.

Remove a device

Removing/unbinding a device means that Argus will no longer send push notifications to this device.

To unbind a device from the current user, use the ID returned by the list endpoint:

Code Block
curl -X DELETE -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/notifications/v1/device/3fa85f64-5717-4562-b3fc-2c963f66afa6

You can check the swagger documentation for a more detailed description of the endpoint and the values that can be used in the Json object.


Notification test endpoints

The endpoints under /notifications/v1/notification  are for debugging/internal use only, and are not usable by users.

Table of Contents