Skip to main content

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
1
POST
/app/users/invitation-code/apply
# Apply invitation code


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"
}
#### Response
{
"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
    string
    required
    at least 6 chars
    at most 40 chars
    only letters, numbers and special characters are allowed
    The old login password.
  • password
    string
    required
    at least 6 chars
    at most 40 chars
    only letters, numbers and special characters are allowed
    The new password.

ChangeUserTypeReq

properties
  • serviceNumber
    String
    [1 ... 31]
    if change user type to RIP, then serviceNumber is required

UserSetDistrictReqDTO

properties
  • districtId
    String
    required
    Reset the district. if the same centre's district will return new accessToken

UserSetDistrictResDTO

properties
  • accessToken
    string
    required
    if status is 1, accessToken will be generated. please delete the old accessToken and reset the new one in the Authorization Bearer token.
  • status
    ApprovalStatus
    required
    change district status. 1:success 2:waiting for approval. if status is not 1, accessToken will be null

UserProfileDto

properties
  • avatarUrl
    String
    avatar address
  • avatarDefault
    boolean
    If 1, the avatar is a default photo; otherwise, it is not a default photo.
  • username
    username
  • nickname
    String
    user's nickname
  • userType
    UserType
    required
    user's type: 1:普通會員, 2:計畫會員, 3:社區員工, 4:其他
  • district
    String
    required
    user's district
  • signature
    String
    user's signature

UserTypeResp

properties
  • name
    String
    required
    user type's name
  • type
    Int
    required
    user's type number

PersonalInfoDto

properties
  • nickname
    String
    [0 ... 100]
    user's nickname
  • signature
    String
    [0 ... 100]
    user's signature
  • gender
    Gender
    required
    user's gender
  • birthday
    Date
    YYYY-MM-DD
    user's birthday

AccountInfoDto

properties
  • username
    String
    user's username
  • email
    String
    user's email
  • phone
    String
    user's phone
  • userType
    UserType
    required
    user's type
  • district
    String
    required
    user's district
  • centre
    String
    required
    user's centre
  • centreEnum
    required
    centreEnum
  • isTypeApproving
    Boolean
    required
    user's type is approving
  • isDistrictApproving
    Boolean
    required
    user's district is approving
  • activityDistrictEnum
    The district for article's activity.

OtpVerificationReqDTO

properties
  • otp
    integer
    required
    The four-digit verification code.
  • otpToken
    string
    required
    Token is generated with expiry time, loginID and nature of OTP.
    The token generated for verification.

OtpResDTO

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

UpdateUsername

properties
  • username
    String
    required
    [4 ... 20]
    update the account's username

UpdatePhone

properties
  • phone
    String
    required
    8-digit mobile phone number starting with 6 or 9

UpdateEmail

properties
  • email
    String
    required
    [1 ... 50]
    new email address

UserSetAvatarReqDTO

properties
  • file
    file
    The file to be uploaded as the avatar

UserMemberApplyStatus

properties
  • serviceNumber
    String
    required
    服務編號
  • applyDate
    Date
    required
    申請日期
  • status
    int
    required
    申請狀態 1-審核中 2-已審核通過 3-審核未通過

UserDistrictApplyStatus

properties
  • applyDate
    String
    required
    申請日期
  • sourceDistrict
    String
    required
    原地區
  • targetDistrict
    String
    required
    申請地區

RemoveUserReq

properties
  • reasonType
    reasonType
    required
    移除原因類型
  • reason
    String
    移除原因

UserSurveyResp

properties
  • centre
    string
    required
    用戶機構
  • title
    string
    問卷標題,如果centre不是SHARE則不顯示
  • link
    string
    問卷連接,如果centre不是SHARE則不顯示

UserInvitationResDTO

properties
  • invitationCode
    string
    The user unique invitation code.
  • coin
    number
    The rewarding coin.
  • maxCoin
    number
    The maximum amount of coin to be rewarded.
  • obtainedCoin
    number
    The user obtained coin.
  • invitedNumber
    number
    The number of usages of the invitation code.

UserApplyInvitationReqDTO

properties
  • invitationCode
    string
    The user unique invitation code.


ApprovalStatus

NameValue
SUCCESS1
WAITING_FOR_APPROVAL2
SUBMIT_APPROVAL3

Gender

NameValue
FEMALE0
MALE1
SECRET2

UserType

NameValue
普通會員1
計劃會員2
社區人員3
其他4

CentreEnum

NameValue
MHAHK香港心理衞生會
NLPRA新生精神康復會
SHARE其他

ReasonType

valueDesc
0其他原因
1我不再需要這個帳戶
2擔心隱私或安全問題
3使用體驗不佳
4太多垃圾郵件或通知