App User API
The App User Management API allows App User to manage their own information. All of these APIs are only allowed when the App User has already logged in.
Endpoints
# Endpoints
Is set password
Request
GET /app/users/is-set-pwd
Response
{
"success": true,
"message": "",
"data": false
}
Reset password
Request (UserResetPasswordReqDTO)
PUT /app/users/password
{
"oldPassword": "asdfI123!",
"password": "gdKidjo33-"
}
Response
{
"success": true,
"message": "",
"data": null
}
Init district
Request (UserSetDistrictReqDTO)
POST /app/users/district
{
"districtId": "b448603a-1909-11ef-8624-4a12d8c2d6fd"
}
Response (UserSetDistrictResDTO)
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJpZFwiOlwiYjQ0Y2UxNmUtMTkwOS0xMWVmLTg2MjQtNGExMmQ4YzJkNmZkXCIsXCJjZW50cmVcIjpcIlNIQVJFXCIsXCJlbmFibGVcIjp0cnVlLFwiYXV0aG9yaXRpZXNcIjpbXCJST0xFX0FETUlOXCJdfSIsImV4cCI6MTcxNjYwNTIzMn0.xJQD_spKZg6MLv6enfYQ4UqhGmAaE-Q5EvGhdC8mBKU",
"status": 1
}
}
Set district
Request (UserSetDistrictReqDTO)
PUT /app/users/district
{
"districtId": "b448603a-1909-11ef-8624-4a12d8c2d6fd"
}
Response (UserSetDistrictResDTO)
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJpZFwiOlwiYjQ0Y2UxNmUtMTkwOS0xMWVmLTg2MjQtNGExMmQ4YzJkNmZkXCIsXCJjZW50cmVcIjpcIlNIQVJFXCIsXCJlbmFibGVcIjp0cnVlLFwiYXV0aG9yaXRpZXNcIjpbXCJST0xFX0FETUlOXCJdfSIsImV4cCI6MTcxNjYwNTIzMn0.xJQD_spKZg6MLv6enfYQ4UqhGmAaE-Q5EvGhdC8mBKU",
"status": 1
}
}
Get type
Request
GET /app/users/type
Response (UserTypeResp)
{
"success": true,
"message": "",
"data": [
{
"name": "普通會員",
"type": 1
},
{
"name": "計劃會員",
"type": 2
}
]
}
Join member
Request (ChangeUserTypeReq)
PUT /app/users/join-member
{
"serviceNumber": "12345567641"
}
Response (UserSetDistrictResDTO)
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJpZFwiOlwiYjQ0Y2UxNmUtMTkwOS0xMWVmLTg2MjQtNGExMmQ4YzJkNmZkXCIsXCJjZW50cmVcIjpcIlNIQVJFXCIsXCJlbmFibGVcIjp0cnVlLFwiYXV0aG9yaXRpZXNcIjpbXCJST0xFX0FETUlOXCJdfSIsImV4cCI6MTcxNjYwNTIzMn0.xJQD_spKZg6MLv6enfYQ4UqhGmAaE-Q5EvGhdC8mBKU",
"status": 1
}
}
Out member
Request
PUT /app/users/out-member
Response (UserSetDistrictResDTO)
{
"success": true,
"message": "",
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJpZFwiOlwiYjQ0Y2UxNmUtMTkwOS0xMWVmLTg2MjQtNGExMmQ4YzJkNmZkXCIsXCJjZW50cmVcIjpcIlNIQVJFXCIsXCJlbmFibGVcIjp0cnVlLFwiYXV0aG9yaXRpZXNcIjpbXCJST0xFX0FETUlOXCJdfSIsImV4cCI6MTcxNjYwNTIzMn0.xJQD_spKZg6MLv6enfYQ4UqhGmAaE-Q5EvGhdC8mBKU",
"status": 1
}
}
Get profile
Request
GET /app/users/profile
Response (UserProfileDto)
{
"success": true,
"message": "",
"data": {
"avatarUrl": "https://amazon.com/xxxxxx",
"avatarDefault": false,
"username": "luffy",
"nickname": "monkey",
"userType": 1,
"district": "深水埗",
"signature": "要成為海賊王的男人"
}
}
Get personal detail
Request
GET /app/users/personal
Response (PersonalInfoDto)
{
"success": true,
"message": "",
"data": {
"nickname": "Luffy",
"signature": "要成為海賊王的男人",
"gender": 1,
"birthday": "1998-04-11"
}
}
Set personal detail
Request (PersonalInfoDto)
PUT /app/users/personal
{
"nickname": "Luffy",
"signature": "要成為海賊王的男人",
"gender": 1,
"birthday": "1998-04-11"
}
Response
{
"success": true,
"message": "",
"data": null
}
Get account detail
Request
GET /app/users/account
Response (AccountInfoDto)
{
"success": true,
"message": "",
"data": {
"username": "AritaOne",
"email": "zwei@aritaone.com",
"phone": null,
"userType": 4,
"district": "中西區",
"centre": "其他",
"centreEnum": "MHAHK",
"isTypeApproving": false,
"isDistrictApproving": false,
"activityDistrictEnum": 3
}
}
Set account username
Request (UpdateUsername)
PUT /app/users/username
{
"username": "aritaOne"
}
{
"success": true,
"message": "",
"data": null
}
Set account phone
Request (UpdatePhone)
PUT /app/users/phone
{
"phone": "97654321"
}
Response (OtpResDTO)
{
"success": true,
"message": "",
"data": {
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
}
Set phone verify OTP
This endpoint verifies the one-time-password verification for setting phone.
Request (OtpVerificationReqDTO)
POST /app/user/phone/verify
{
"otp": 37695,
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
Response
{
"success": true,
"message": "",
"data": null
}
Set account email
Request (UpdateEmail)
PUT /app/users/email
{
"email": "luffy@aritaone.com"
}
Response (OtpResDTO)
{
"success": true,
"message": "",
"data": {
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
}
Set email verify OTP
This endpoint verifies the one-time-password verification for setting email.
Request (OtpVerificationReqDTO)
POST /app/users/email/verify
{
"otp": 37695,
"otpToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcnkiOiIyMDI0LTA0LTIzVDA5OjA0OjQ1WiIsImxvZ2luSUQiOiJ0ZXN0QGFyaXRhb25lLmNvbSIsIm5hdHVyZSI6MX0.iTIbn6BUqsAAxLVrTSHYxkLV39ajcp8H-PL_KYb_3OI"
}
Response
{
"success": true,
"message": "",
"data": null
}
Set avatar
This endpoint sets user's avatar.
Request (UserSetAvatarReqDTO)
POST /app/users/avatar
Key | Type | Value |
---|---|---|
file | file | - |
Response
{
"success": true,
"message": "",
"data": null
}
Delete avatar
This endpoint deletes user's avatar.
Request
DELETE /app/users/avatar
Response
{
"success": true,
"message": "",
"data": null
}
Member apply
This endpoint get user's member applying status
Request
GET /app/users/member-apply
Response (UserMemberApplyStatus)
{
"success": true,
"message": "",
"data": {
"serviceNumber": "31241242134",
"applyDate": "2024-07-03",
"status": 1
}
}
District apply
This endpoint get user's district applying. if data is null, it means user has not applying.
Request
GET /app/users/district-apply
Response (UserDistrictApplyStatus)
{
"success": true,
"message": "",
"data": {
"applyDate": "2024年09月02日",
"sourceDistrict": "北區",
"targetDistrict": "大埔"
}
}
Remove self
Request(RemoveUserReq)
DELETE /app/users/remove
{
"reasonType": 0,
"reason": "我唔中意呢个APP"
}
Response
{
"success": true,
"message": "",
"data": null
}
Is share
judge user is share or not
Request
GET /app/users/is-share
Response (UserSurveyResp)
{
"success": true,
"message": "",
"data": {
"centre": "SHARE",
"title": "初步評估問卷",
"link": "https://docs.google.com/forms/d/e/1FAIpQLSdeSrSbeemctFJt3NfcXrOIlk5hH2S6_Tje6IxJkZ2Se4rBog/viewform"
}
}
Get invitation code
This endpoint aims to get the unique invitation code.
Request
GET /app/users/invitation-code
Response (UserInvitationResDTO)
{
"success": true,
"message": "",
"data": {
"invitationCode": "254648",
"coin": 100,
"maxCoin": 300,
"obtainedCoin": 100,
"invitedNumber": 1
}
}
Apply invitation code
This endpoint aims to apply the unique invitation code.
Request (UserApplyInvitationReqDTO)
POST /app/users/invitation-code/apply
{
"invitationCode": "254648"
}
Response
{
"success": true,
"message": "",
"data": null
}
Resources
UserResetPasswordReqDTO
properties
oldPassword
stringrequiredat least 6 charsat most 40 charsonly letters, numbers and special characters are allowedThe old login password.
password
stringrequiredat least 6 charsat most 40 charsonly letters, numbers and special characters are allowedThe new password.
ChangeUserTypeReq
properties
serviceNumber
String[1 ... 31]if change user type to RIP, then serviceNumber is required
UserSetDistrictReqDTO
properties
districtId
StringrequiredReset the district. if the same centre's district will return new accessToken
UserSetDistrictResDTO
properties
accessToken
stringrequiredif status is 1, accessToken will be generated. please delete the old accessToken and reset the new one in the Authorization Bearer token.
change district status. 1:success 2:waiting for approval. if status is not 1, accessToken will be null
UserProfileDto
properties
avatarUrl
Stringavatar address
avatarDefault
booleanIf 1, the avatar is a default photo; otherwise, it is not a default photo.
username
username
nickname
Stringuser's nickname
user's type: 1:普通會員, 2:計畫會員, 3:社區員工, 4:其他
district
Stringrequireduser's district
signature
Stringuser's signature
UserTypeResp
properties
name
Stringrequireduser type's name
type
Intrequireduser's type number
PersonalInfoDto
properties
nickname
String[0 ... 100]user's nickname
signature
String[0 ... 100]user's signature
user's gender
birthday
DateYYYY-MM-DDuser's birthday
AccountInfoDto
properties
username
Stringuser's username
email
Stringuser's email
phone
Stringuser's phone
user's type
district
Stringrequireduser's district
centre
Stringrequireduser's centre
centreEnum
isTypeApproving
Booleanrequireduser's type is approving
isDistrictApproving
Booleanrequireduser's district is approving
activityDistrictEnum
The district for article's activity.
OtpVerificationReqDTO
properties
otp
integerrequiredThe four-digit verification code.
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
OtpResDTO
properties
otpToken
stringrequiredToken is generated with expiry time, loginID and nature of OTP.The token generated for verification.
UpdateUsername
properties
username
Stringrequired[4 ... 20]update the account's username
UpdatePhone
properties
phone
Stringrequired8-digit mobile phone number starting with 6 or 9
UpdateEmail
properties
email
Stringrequired[1 ... 50]new email address
UserSetAvatarReqDTO
properties
file
fileThe file to be uploaded as the avatar
UserMemberApplyStatus
properties
serviceNumber
Stringrequired服務編號
applyDate
Daterequired申請日期
status
intrequired申請狀態 1-審核中 2-已審核通過 3-審核未通過
UserDistrictApplyStatus
properties
applyDate
Stringrequired申請日期
sourceDistrict
Stringrequired原地區
targetDistrict
Stringrequired申請地區
RemoveUserReq
properties
移除原因類型
reason
String移除原因
UserSurveyResp
properties
centre
stringrequired用戶機構
title
string問卷標題,如果centre不是SHARE則不顯示
link
string問卷連接,如果centre不是SHARE則不顯示
UserInvitationResDTO
properties
invitationCode
stringThe user unique invitation code.
coin
numberThe rewarding coin.
maxCoin
numberThe maximum amount of coin to be rewarded.
obtainedCoin
numberThe user obtained coin.
invitedNumber
numberThe number of usages of the invitation code.
UserApplyInvitationReqDTO
properties
invitationCode
stringThe user unique invitation code.
ApprovalStatus
Name | Value |
---|---|
SUCCESS | 1 |
WAITING_FOR_APPROVAL | 2 |
SUBMIT_APPROVAL | 3 |
Gender
Name | Value |
---|---|
FEMALE | 0 |
MALE | 1 |
SECRET | 2 |
UserType
Name | Value |
---|---|
普通會員 | 1 |
計劃會員 | 2 |
社區人員 | 3 |
其他 | 4 |
CentreEnum
Name | Value |
---|---|
MHAHK | 香港心理衞生會 |
NLPRA | 新生精神康復會 |
SHARE | 其他 |
ReasonType
value | Desc |
---|---|
0 | 其他原因 |
1 | 我不再需要這個帳戶 |
2 | 擔心隱私或安全問題 |
3 | 使用體驗不佳 |
4 | 太多垃圾郵件或通知 |