Omniplex Docs

Notifications

These API endpoints are related to user notifications on Omniplex

Get Notifications Info

GET
/users/notifications/info

Gets info needed to subscribe to push notifications (VAPID public key)

Response Body

Success

application/json
  1. response
public_key?string
Example Request
curl -X GET 'https://spider.omniplex.gg/users/notifications/info'
Example Response
{  "public_key": "string"}

Get User Notifications

GET
/users/{id}/notifications

Gets a users notifications

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

User ID

Response Body

Success

application/json
  1. response
notifications?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/notifications'
Example Response
{  "notifications": [    {      "browser_info": {        "browser": "string",        "browser_ver": "string",        "mobile": true,        "os": "string"      },      "created_at": "2019-08-24T14:15:22Z",      "endpoint": "string",      "notif_id": "string"    }  ]}

Create User Notification

POST
/users/{id}/notifications

Creates a new subscription for a push notification. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

User ID

Request Body

application/json
  1. body
auth?string

The auth key for the subscription returned by PushSubscription

endpoint?string

The endpoint for the subscription returned by PushSubscription

p256dh?string

The p256dh key for the subscription returned by PushSubscription

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/notifications' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}
DELETE
/users/{id}/notification

Deletes a users notification. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

User ID

Query Parameters

notif_id*string

Notification ID

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X DELETE 'https://spider.omniplex.gg/users/string/notification?notif_id=string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}
GET
/users/{id}/notification-prefs

Returns every known alert category and whether the user wants notifications for it. A category with no stored row defaults to true.

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

User ID

Response Body

Success

application/json
  1. response
[key: string]?boolean
Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/notification-prefs'
Example Response
{  "property1": true,  "property2": true}
PATCH
/users/{id}/notification-prefs

Partially updates the calling user's notification preferences -- only the categories present in the request body are changed.

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

User ID

Request Body

application/json
  1. body
[key: string]?boolean

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X PATCH 'https://spider.omniplex.gg/users/string/notification-prefs' \  -H 'Content-Type: application/json' \  -d '{  "property1": true,  "property2": true}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}