Notification Center (1.0.0)

Download OpenAPI specification:Download

Fotis Alexandrou: [email protected] URL: https://www.falexandrou.com License: MIT

Awesome Notification center

A notification preferences center to use as a micro-service for recording your user's consents. It currently features two types of consents: email_notifications and sms_notifications (which are self-explanatory) and provides an audit trail for the events that led up to the current user's consent status.

User

The User object is identified by a unique ID (in the form of UUID) and represents a user of the system. You may add a user by providing their email address and you'll get an ID in the response. You may then use this ID to retrieve their information and the user's consent status

Create a new user

Request Body schema: application/json
email
string <email>

The email of the user to create

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "email": "[email protected]",
  • "consents": [
    ]
}

Get a User by id

Return a User by a given id

path Parameters
id
required
string <uuid> (UUID)
Example: 123e4567-e89b-12d3-a456-426614174000

The id of the user to get

Responses

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "email": "[email protected]",
  • "consents": [
    ]
}

Delete a User by id

Delete a User by a given id

path Parameters
id
required
string <uuid> (UUID)
Example: 123e4567-e89b-12d3-a456-426614174000

The id of the user to delete

Responses

Response samples

Content type
application/json
{ }

Event

An event works as the audit trail to generate the user's current consent status. Each event should specify a consent type and whether they're enabled or not, plus the user it refers to. You may provide multiple events at once.

Create a new event

Request Body schema: application/json
object
Array of objects (Consent) [ items ]

the user's consent preferences

Responses

Request samples

Content type
application/json
{
  • "user": {
    },
  • "consents": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000",
  • "type": "email_notifications",
  • "enabled": true
}