Skip to main content

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
    string
    required
    The login identification. This field can only be phone.

SMSResDTO

properties
  • otpToken
    string
    required
    Token is generated with expiry time, loginID and nature of OTP.
    The token generated for verification.

EmailReqDTO

properties
  • loginID
    string
    required
    The login identification. This field can only be login email.

WelcomeEmailReqDTO

properties
  • url
    string
    required
    The login page of the Web Portal.
  • name
    string
    required
    The name of the newly created user.
  • email
    string
    required
    The email of the newly created user.
  • password
    string
    required
    The generated password of the newly created user.

EmailResDTO

properties
  • otpToken
    string
    required
    Token is generated with expiry time, loginID and nature of OTP.
    The token generated for verification.

OTPReqDTO

properties
  • otp
    integer
    required
    The OTP.
  • otpToken
    strig
    required
    The generated OTP token. This will be used omly once.

OTPResDTO

properties
  • loginID
    string
    required
    The login identification. This field can be login email or phone.

PushReqDTO

properties
  • deviceToken
    string
    required
    Device Token.
  • model
    PushModel
    required
    The model code.
  • title
    string
    required
    The title of the message.
  • body
    string
    required
    The body of the message.
  • data
    required
    navigation enum value.

BatchPushReqDTO

properties
  • devices
    PushReqDTO
    required
    A list of devices' informmation

ValueDescription
1通知中心
2問卷列表
3精神健康資訊
4步行目標
5地區資訊
6主頁
7親友列表
8學習課程