Web Friend API
The Web Friend API allows Web User to manage the friends in the Web Portal.
Endpoints
# Endpoints
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
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
searchKey
stringThe search key should be about title.
userId
string用戶ID
A list of friend statuses.
FriendStatusDTO
properties
type
stringThe identifier of the friend status.
desc
stringThe name of the friend status.
FriendSummaryResDTO
properties
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
stringThe identifier of the friend request. It is null if they are already friend.
friendId
stringThe identifier of the friend relationship. It is null if they are not yet friend.
userId
StringThe identifier of the user.
username
StringThe username of the user.
email
stringThe email of the user.
phone
StringThe phone of the user.
district
StringThe district of the user
userType
int1,2用戶類別:1-普通會員 2-計畫會員
serviceNumber
String服務編號
friendStatus
The friend status of the friend relationship.
friendAt
datetimeThe time when the friend relationship was made.
FilterBlockedFriendReqDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
searchKey
stringThe search key should be about title.
userId
string用戶ID
BlockedFriendSummaryResDTO
properties
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
stringThe identifier of the friend relationship.
userId
StringThe identifier of the user.
username
StringThe username of the user.
email
stringThe email of the user.
phone
StringThe phone of the user.
district
StringThe district of the user
userType
int1,2用戶類別:1-普通會員 2-計畫會員
serviceNumber
String服務編號
staff
string服務職員
SearchOrgUserFriendReqDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
searchKey
stringThe search key should be about title.
userId
string用戶ID
SearchOrgUserFriendSummaryResDTO
properties
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
StringThe identifier of the user.
username
StringThe username of the user.
email
stringThe email of the user.
phone
StringThe phone of the user.
district
StringThe district of the user
userType
int1,2用戶類別:1-普通會員 2-計畫會員
serviceNumber
String服務編號
staff
string服務職員
SearchFreeUserFriendReqDTO
properties
Indicates the page information of the resource.
sortings
A list of sorting elements, the order of the list matters.
searchKey
stringThe search key should be about title.
userId
string用戶ID
SearchFreeUserFriendSummaryResDTO
properties
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
StringThe identifier of the user.
username
StringThe username of the user.
email
stringThe email of the user.
phone
StringThe phone of the user.
district
StringThe district of the user
userType
int1,2用戶類別:1-普通會員 2-計畫會員
serviceNumber
String服務編號
staff
string服務職員
AddFriendReqDTO
properties
userId
stringrequiredThe identifier of the user.
targetUserIds
arrayrequiredThe array of the target user ids.
AcceptFriendReqDTO
properties
friendRequestId
arrayThe list of the friend request id.
RejectFriendReqDTO
properties
friendRequestId
arrayThe list of the friend request id.
SetFriendPermissionReqDTO
properties
userId
string用戶ID
actorId
stringThe userId of the actor.
stepView
booleanIt indicates if the walking goal is viewable or not. If it is null, this field will not be updated.
mapView
booleanIt indicates if the map is viewable or not. If it is null, this field will not be updated.
mascotView
booleanIt indicates if the mascot is viewable or not. If it is null, this field will not be updated.
avatarView
booleanIt indicates if the avatar is viewable or not. If it is null, this field will not be updated.
FriendDetailResDTO
properties
friendRequestId
stringThe identifier of the friend request.
friendId
stringThe identifier of the friend relationship.
friendStatus
The friend status of the friend relationship.
friendAt
datetimeThe time when the friend relationship was made.
account
It indicates if the step is viewable
permission
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
booleanIt indicates if the step is viewable
mapView
booleanIt indicates if the map is viewable
mascotView
booleanIt indicates if the mascot is viewable
avatarView
booleanIt indicates if the avatar is viewable
SetFriendDefaultPermissionReqDTO
properties
searchable
booleanIt indicates if the user is searchable or not. If it is null, this field will not be updated.
requestable
booleanIt indicates if the user is requestable or not. If it is null, this field will not be updated.
stepViewEnum
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
booleanIt indicates if the user is searchable or not. If it is null, this field will not be updated.
requestable
booleanIt indicates if the user is requestable or not. If it is null, this field will not be updated.
stepViewEnum
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
Name | Value |
---|---|
請求中 | 0 |
正常 | 1 |