Skip to main content

Notice API

The Notice API provides ways for staff send Info to users.

Endpoints

# Endpoints


Notice page

獲取當前用戶通知分页

Request

POST /web/notice/page
{
"userId": "1905e907-20e3-46b7-80ec-01ec976d6d78",
"startDate": "2024-06-10",
"endDate": "2024-06-18",
"pagination": {
"page": 1,
"size": 10
},
"sortings": [
{
"direction": "DESC",
"property": "createdAt"
}
]
}

Response (NoticePageResp)

{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 3,
"totalPages": 1
},
"sortings": [
{
"direction": "DESC",
"property": "createdAt"
}
],
"items": [
{
"id": "b2be0e33-8f22-4a21-be9a-d97e133bc737",
"sendTime": "2024-06-17T17:19:45.731112",
"title": "加入計劃會員申請",
"content": "您已成功提交加入計劃會員申請,請耐心等待審核結果!",
"isRead": false,
"missionLink": 0
},
{
"id": "b2be0e33-8f22-4a21-be9a-d97e133bc737",
"sendTime": "2024-06-17T11:20:41.279588",
"title": "加入中心成功",
"content": "恭喜您!您已經成功加入中心!",
"isRead": false,
"missionLink": 0
},
{
"id": "b2be0e33-8f22-4a21-be9a-d97e133bc737",
"sendTime": "2024-06-14T15:30:15.38132",
"title": "您提交了切換地區申請",
"content": "您已提交了從地區【中西區】變更至地區【九龍城】的切換地區申請。",
"isRead": false,
"missionLink": 0
}
]
}
]
}

Org send notice

向機構用戶發送通知

Request (NoticeSendReq)

POST /web/notice/org/send
{
"userId": "049cea33-426b-47a1-aec3-904a193c126b",
"title": "益力多派街坊",
"content": "今日你飲咗未啊?"
}
#### Response
{
"success": true,
"message": "",
"data": null
}

Free send notice

向無機構用戶發送通知

Request (NoticeSendReq)

POST /web/notice/free/send
{
"userId": "049cea33-426b-47a1-aec3-904a193c126b",
"title": "益力多派街坊",
"content": "今日你飲咗未啊?"
}
#### Response
{
"success": true,
"message": "",
"data": null
}

Org send notice batch

批量向機構用戶發送通知

Request (NoticeSendBatchReq)

POST /web/notice/org/send-batch
{
"userIds": [
"049cea33-426b-47a1-aec3-904a193c126b",
"d841daa3-6ed9-47b9-a192-ec92b7e2a035"
],
"title": "生命滿希望",
"content": "打波先嚟落雨,唔通連個天都唔鍾意我...?"
}
#### Response
{
"success": true,
"message": "",
"data": null
}

Free send notice batch

批量向機構用戶發送通知

Request (NoticeSendBatchReq)

POST /web/notice/free/send-batch
{
"userIds": [
"049cea33-426b-47a1-aec3-904a193c126b",
"d841daa3-6ed9-47b9-a192-ec92b7e2a035"
],
"title": "生命滿希望",
"content": "打波先嚟落雨,唔通連個天都唔鍾意我...?"
}
#### Response
{
"success": true,
"message": "",
"data": null
}


Resources

NoticePageFilterReq

properties
  • userId
    String
    required
    用戶的ID
  • startDate
    date
    開始時間
  • endDate
    date
    結束時間
  • pagination
    pagination
    required
    分頁參數
  • sortings
    排序字段

NoticePageResp

This class extends PaginationAndSorting

properties
  • id
    String
    required
    通知ID
  • sendTime
    datetime
    required
    發送時間
  • title
    String
    required
    標題
  • content
    String
    required
    內容
  • isRead
    boolean
    required
    是否已讀
  • missionLink
    MissionLink
    The in-app redirect link of the mission.

NoticeSendReq

properties
  • userId
    string
    required
    發送用戶ID
  • title
    string
    required
    [1 ... 50]
    通知標題
  • content
    string
    [0 ... 255]
    通知內容

NoticeSendBatchReq

properties
  • userIds
    array[string]
    required
    批量發送的用戶ID
  • title
    string
    required
    [1 ... 50]
    通知標題
  • content
    string
    [0 ... 255]
    通知內容