saracalihan/notize

HTTP Endpoint

Opened this issue · 0 comments

Currently, users are pushing notifications directly to the queues. Notifications should be included in the system in a restful way for easier use.

We should use an access token for authentication. Maybe someday we can add authorization for notification types.

Suggested Routes:

Send Mail:

POST /notification/mail

REQUEST:
headers:

"Content-Type": "application/json",
"X-Access-Token": "<access token>"

body:

{
    "template": "PLAIN_TEXT | <another template name>",
    "from": {},
    "to": {},
    "data": {}
}

RESPONSE:
status: 200

Refresh Token:

GET /authentication/refresh-token

REQUEST:
headers:

"Content-Type": "application/json",
"X-Access-Token": "<access token>"

RESPONSE:
status: 200
body:

{
    "userId": "<user id>",
    "token": "<token string>",
    "authority": {
        "mail": true,
        "sms": false
    },
    "expiredAt": "<expire date>"
}