Notification Service
Notification service will handle all the notification-related services, including SMS, email and push notification.
Endpoints
# Endpoints
Send SMS
This endpoint sends a SMS OTP.
Request (SMSReqDTO)
POST /sms/send
{
"loginID": "+85268098227"
}
Response (SMSResDTO)
{
"success": true,
"message": "",
"data": {
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
}
Send Email
This endpoint sends an email OTP.
Request (EmailReqDTO)
POST /email/send
{
"loginID": "test@aritaone.com"
}
Response (EmailResDTO)
{
"success": true,
"message": "",
"data": {
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
}
Send Welcome Email
This endpoint sends a welcome email to the newly created staff.
Request (WelcomeEmailReqDTO)
POST /email/send/welcome
{
"url": "https://test.aritaone.com/login",
"name": "Test account",
"email": "test@aritaone.com",
"password": "ookZ3es!"
}
Response
{
"success": true,
"message": "",
"data": null
}
Verify OTP
This endpoint verifies OTP.
Request (OTPReqDTO)
POST /otp/verify
{
"otp": 9781,
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImJpbGxAYXJpdGFvbmUuY29tIiwidGltZSI6IjA1LzE0LzIwMjQsIDExOjQwOjUxIiwib3RwIjoiOTc4MSJ9.jKaudX8-SbiE-x1hcIK2WMKXCOvApFlx74Vy_TDkGJw"
}
Response (OTPResDTO)
{
"success": true,
"message": "",
"data": {
"loginID": "test@aritaone.com"
}
}
Push notification
This endpoint sends a single push notification.
Request (PushReqDTO)
POST /push
{
"deviceToken": "averylongtoken",
"model": 0,
"title": "title",
"body": "body",
"data": {
"navigation": 1
}
}
Response
{
"success": true,
"message": "",
"data": null
}
Batch Push notification
This endpoint sends multiple push notifications.
Request (BatchPushReqDTO)
POST /push/batch
{
"devices": [
{
"deviceToken": "averylongtoken",
"model": 0,
"title": "title",
"body": "body",
"data": {
"navigation": 1
}
}
]
}
Response
{
"success": true,
"message": "",
"data": null
}
Resources
SMSReqDTO
properties
loginID
stringrequiredThe login identification. This field can only be phone.
SMSResDTO
properties
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
EmailReqDTO
properties
loginID
stringrequiredThe login identification. This field can only be login email.
WelcomeEmailReqDTO
properties
url
stringrequiredThe login page of the Web Portal.
name
stringrequiredThe name of the newly created user.
email
stringrequiredThe email of the newly created user.
password
stringrequiredThe generated password of the newly created user.
EmailResDTO
properties
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
OTPReqDTO
properties
otp
integerrequiredThe OTP.
otpToken
strigrequiredThe generated OTP token. This will be used omly once.
OTPResDTO
properties
loginID
stringrequiredThe login identification. This field can be login email or phone.
PushReqDTO
properties
deviceToken
stringrequiredDevice Token.
The model code.
title
stringrequiredThe title of the message.
body
stringrequiredThe body of the message.
navigation enum value.
BatchPushReqDTO
properties
A list of devices' informmation
NavigationEnum
Value | Description |
---|---|
1 | 通知中心 |
2 | 問卷列表 |
3 | 精神健康資訊 |
4 | 步行目標 |
5 | 地區資訊 |
6 | 主頁 |
7 | 親友列表 |
8 | 學習課程 |