Skip to main content

Web Friend API

The Web Friend API allows Web User to manage the friends in the Web Portal.

Endpoints

# Endpoints
1
POST
/web/friends/users/page
# Filter friends
1
POST
/web/friends/blocked-users/page
# Filter blocked friends
1
POST
/web/friends/search-org-users/page
# Search org users for friends
1
POST
/web/friends/search-free-users/page
# Search free users for friends
1
POST
/web/friends/users/accept
# Accept friends
1
POST
/web/friends/users/reject
# Reject friends
1
POST
/web/friends/users
# Add friends
1
DELETE
/web/friends/users
# Remove friends
1
POST
/web/friends/users/block
# Block friends
1
DELETE
/web/friends/users/block
# Unblock friends
1
POST
/web/friends/permissions
# Set friend permission
1
GET
/web/friends/users/{user_id}?friend={friend_id}&friend-request={friend_reuqest_id}
# Get friend detail
1
POST
/web/friends/users/{user_id}/default-permissions
# Set default friend permission
1
GET
/web/friends/users/{user_id}/default-permissions
# Get default friend permission

Filter friends

This endpoint helps filter friends.

Request (FilterFriendReqDTO)

POST /web/friends/users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": "",
"userId": "",
"friendStatuses": [
0,
1
]
}

Response (FriendSummaryResDTO)

{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"friendRequestId": "fdqyky466-404e-408e-90fb-e4d663fde7ba",
"friendId": "fdsgdhfh-404e-408e-90fb-e4d663fde7ba",
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"username": "aritaone",
"email": "aritaone@example.com",
"phone": "67654321",
"district": "九龍城",
"userType": 2,
"serviceNumber": "123456789",
"friendStatus": 2,
"friendAt": "2024-06-19T12:29:14.335698"
}
]
}
]
}

Filter blocked friends

This endpoint helps filter blocked friends.

Request (FilterBlockedFriendReqDTO)

POST /web/friends/blocked-users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": "",
"userId": ""
}

Response (BlockedFriendSummaryResDTO)

{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"friendId": "fdsgdhfh-404e-408e-90fb-e4d663fde7ba",
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"username": "aritaone",
"email": "aritaone@example.com",
"phone": "67654321",
"district": "九龍城",
"userType": 2,
"serviceNumber": "123456789",
"staff": "周小姐"
}
]
}
]
}

Search org users for friends

This endpoint helps search org users for friends.

Request (SearchOrgUserFriendReqDTO)

POST /web/friends/search-org-users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": "",
"userId": ""
}

Response (SearchOrgUserFriendSummaryResDTO)

{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"username": "aritaone",
"email": "aritaone@example.com",
"phone": "67654321",
"district": "九龍城",
"userType": 2,
"serviceNumber": "123456789",
"staff": "周小姐"
}
]
}
]
}

Search free users for friends

This endpoint helps search free users for friends.

Request (SearchFreeUserFriendReqDTO)

POST /web/friends/search-free-users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": "",
"userId": ""
}

Response (SearchFreeUserFriendSummaryResDTO)

{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"username": "aritaone",
"email": "aritaone@example.com",
"phone": "67654321",
"district": "九龍城",
"userType": 2,
"serviceNumber": null,
"staff": null
}
]
}
]
}

Accept friends

This endpoint helps accept friends.

Request (AcceptFriendReqDTO)

POST /web/friends/users/accept
{
"friendRequestIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Reject friends

This endpoint helps reject friends.

Request (RejectFriendReqDTO)

POST /web/friends/users
{
"friendRequestIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Add friends

This endpoint helps add friends.

Request (AddFriendReqDTO)

POST /web/friends/users
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"targetUserIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba",
"gdgfgyqa-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Remove friends

This endpoint helps remove friends.

Request (RemoveFriendReqDTO)

DELETE /web/friends/users
{
"friendIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba",
"gdgfgyqa-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Block friends

This endpoint helps block friends.

Request (BlockFriendReqDTO)

POST /web/friends/users/block
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"targetUserIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba",
"gdgfgyqa-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Unblock friends

This endpoint helps unblock friends.

Request (UnblockFriendReqDTO)

DELETE /web/friends/users/block
{
"friendBlockIds": [
"b618fcfb-404e-408e-90fb-e4d663fde7ba",
"gdgfgyqa-404e-408e-90fb-e4d663fde7ba"
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Set friend permission

This endpoint helps set friend permissions

Request (SetFriendPermissionReqDTO)

POST /web/friends/permissions
{
"userId": "",
"actorId": "",
"stepView": true,
"mapView": true,
"mascotView": true,
"avatarView": true
}

Response

{
"success": true,
"message": "",
"data": null
}

Get friend detail

This endpoint helps get friend detail.

Request

Please note that either friend or friend-request will be used at a time.

GET /web/friends/users/{user_id}?friend={friend_id}&friend-request={friend_reuqest_id}

Response (FriendDetailResDTO)

{
"success": true,
"message": "",
"data": {
"friendRequestId": "fdsgfegdh-404e-408e-90fb-e4d663fde7ba",
"friendId": "fdsgdhfh-404e-408e-90fb-e4d663fde7ba",
"friendStatus": 1,
"friendAt": "2024-06-19T12:29:14.335698",
"account": {
"id": "d841daa3-6ed9-47b9-a192-ec92b7e2a035",
"username": "user4",
"nickname": null,
"phone": null,
"email": "user4@example.com",
"district": "九龍城",
"userType": 2,
"gender": 0,
"birthday": null,
"serviceNumber": "12345678",
"avatarUrl": "https://jcci-test-media.aritaone.com/share/default/user/profile/1",
"signature": null
},
"permission": {
"stepView": true,
"mapView": true,
"mascotView": true,
"avatarView": true
}
}
}

Set default friend permission

This endpoint helps set default friend permission.

Request (SetFriendDefaultPermissionReqDTO)

POST /web/friends/users/{user_id}/default-permissions
{
"searchable": true,
"requestable": true,
"stepViewEnum": 1,
"mapViewEnum": 0,
"mascotViewEnum": 2,
"avatarViewEnum": 2
}

Response

{
"success": true,
"message": "",
"data": null
}

Get default friend permission

This endpoint helps get default friend permission.

Request

GET /web/friends/users/{user_id}/default-permissions

Response (FriendDefaultPermissionResDTO)

{
"success": true,
"message": "",
"data": {
"searchable": true,
"requestable": true,
"stepViewEnum": 1,
"mapViewEnum": 0,
"mascotViewEnum": 2,
"avatarViewEnum": 2
}
}


Resources

FilterFriendReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • searchKey
    string
    The search key should be about title.
  • userId
    string
    用戶ID
  • friendStatuses
    required
    default:  [0,1]
    A list of friend statuses.

FriendStatusDTO

properties
  • type
    string
    The identifier of the friend status.
  • desc
    string
    The name of the friend status.

FriendSummaryResDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • A list of filtered elements.

FriendSummaryItemResDTO

properties
  • friendRequestId
    string
    The identifier of the friend request. It is null if they are already friend.
  • friendId
    string
    The identifier of the friend relationship. It is null if they are not yet friend.
  • userId
    String
    The identifier of the user.
  • username
    String
    The username of the user.
  • email
    string
    The email of the user.
  • phone
    String
    The phone of the user.
  • district
    String
    The district of the user
  • userType
    int
    1,2
    用戶類別:1-普通會員 2-計畫會員
  • serviceNumber
    String
    服務編號
  • friendStatus
    FriendStatus
    The friend status of the friend relationship.
  • friendAt
    datetime
    The time when the friend relationship was made.

FilterBlockedFriendReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • searchKey
    string
    The search key should be about title.
  • userId
    string
    用戶ID

BlockedFriendSummaryResDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • A list of filtered elements.

BlockedFriendSummaryItemResDTO

properties
  • friendId
    string
    The identifier of the friend relationship.
  • userId
    String
    The identifier of the user.
  • username
    String
    The username of the user.
  • email
    string
    The email of the user.
  • phone
    String
    The phone of the user.
  • district
    String
    The district of the user
  • userType
    int
    1,2
    用戶類別:1-普通會員 2-計畫會員
  • serviceNumber
    String
    服務編號
  • staff
    string
    服務職員

SearchOrgUserFriendReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • searchKey
    string
    The search key should be about title.
  • userId
    string
    用戶ID

SearchOrgUserFriendSummaryResDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • A list of filtered elements.

SearchOrgUserFriendSummaryItemResDTO

properties
  • userId
    String
    The identifier of the user.
  • username
    String
    The username of the user.
  • email
    string
    The email of the user.
  • phone
    String
    The phone of the user.
  • district
    String
    The district of the user
  • userType
    int
    1,2
    用戶類別:1-普通會員 2-計畫會員
  • serviceNumber
    String
    服務編號
  • staff
    string
    服務職員

SearchFreeUserFriendReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • searchKey
    string
    The search key should be about title.
  • userId
    string
    用戶ID

SearchFreeUserFriendSummaryResDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • A list of filtered elements.

SearchFreeUserFriendSummaryItemResDTO

properties
  • userId
    String
    The identifier of the user.
  • username
    String
    The username of the user.
  • email
    string
    The email of the user.
  • phone
    String
    The phone of the user.
  • district
    String
    The district of the user
  • userType
    int
    1,2
    用戶類別:1-普通會員 2-計畫會員
  • serviceNumber
    String
    服務編號
  • staff
    string
    服務職員

AddFriendReqDTO

properties
  • userId
    string
    required
    The identifier of the user.
  • targetUserIds
    array
    required
    The array of the target user ids.

AcceptFriendReqDTO

properties
  • friendRequestId
    array
    The list of the friend request id.

RejectFriendReqDTO

properties
  • friendRequestId
    array
    The list of the friend request id.

SetFriendPermissionReqDTO

properties
  • userId
    string
    用戶ID
  • actorId
    string
    The userId of the actor.
  • stepView
    boolean
    It indicates if the walking goal is viewable or not. If it is null, this field will not be updated.
  • mapView
    boolean
    It indicates if the map is viewable or not. If it is null, this field will not be updated.
  • mascotView
    boolean
    It indicates if the mascot is viewable or not. If it is null, this field will not be updated.
  • avatarView
    boolean
    It indicates if the avatar is viewable or not. If it is null, this field will not be updated.

FriendDetailResDTO

properties
  • friendRequestId
    string
    The identifier of the friend request.
  • friendId
    string
    The identifier of the friend relationship.
  • friendStatus
    FriendStatus
    The friend status of the friend relationship.
  • friendAt
    datetime
    The time when the friend relationship was made.
  • It indicates if the step is viewable
  • It indicates if the step is viewable

UserAccountDTO

properties
  • id
    string
    用戶ID
  • username
    string
    用戶名稱
  • nickname
    string
    暱稱
  • phone
    string
    電話號碼
  • email
    string
    電郵地址
  • district
    string
    所屬地區
  • userType
    int
    用戶類別:1-普通會員 2-計畫會員
  • level
    int
    級別,userType=2時必填
  • serviceNumber
    string
    服務編號,userType=2時必填
  • gender
    int
    性別:0-女,1-男,2-NA
  • birthday
    date
    出生日期
  • signature
    string
    個性化字眼
  • avatarUrl
    string
    頭像

UserPermissionDTO

properties
  • stepView
    boolean
    It indicates if the step is viewable
  • mapView
    boolean
    It indicates if the map is viewable
  • mascotView
    boolean
    It indicates if the mascot is viewable
  • avatarView
    boolean
    It indicates if the avatar is viewable

SetFriendDefaultPermissionReqDTO

properties
  • searchable
    boolean
    It indicates if the user is searchable or not. If it is null, this field will not be updated.
  • requestable
    boolean
    It indicates if the user is requestable or not. If it is null, this field will not be updated.
  • stepViewEnum
    PemissionEnum
    It indicates if the walking goal is viewable or not. If it is null, this field will not be updated.
  • mapViewEnum
    It indicates if the map is viewable or not. If it is null, this field will not be updated.
  • mascotViewEnum
    It indicates if the mascot is viewable or not. If it is null, this field will not be updated.
  • avatarViewEnum
    It indicates if the avatar is viewable or not. If it is null, this field will not be updated.

FriendDefaultPermissionResDTO

properties
  • searchable
    boolean
    It indicates if the user is searchable or not. If it is null, this field will not be updated.
  • requestable
    boolean
    It indicates if the user is requestable or not. If it is null, this field will not be updated.
  • stepViewEnum
    PemissionEnum
    It indicates if the walking goal is viewable or not. If it is null, this field will not be updated.
  • mapViewEnum
    It indicates if the map is viewable or not. If it is null, this field will not be updated.
  • mascotViewEnum
    It indicates if the mascot is viewable or not. If it is null, this field will not be updated.
  • avatarViewEnum
    It indicates if the avatar is viewable or not. If it is null, this field will not be updated.


FriendStatus

NameValue
請求中0
正常1