Page tree
Skip to end of metadata
Go to start of metadata

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.

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.

{
  ...
  "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:

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.

List registered devices

List registered devices on the current user:

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


This returns a list of devices:

{
  ...
  "data": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "type": "iphone",
      "name": "My iPhone",
      "flags": []
    }
  ]
}

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.

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:

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/notifications/v1/device -d '{
  "type": "iphone",
  "name": "My iPhone",
  "token": "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:

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.

  • No labels