Skip to main content

App Friend API

The App Friend API allows App User to manage the friends in the App.

Endpoints

# Endpoints
1
POST
/app/friends/users/page
# Filter friends
1
POST
/app/friends/request-users/page
# Filter friend requests
1
GET
/app/friends/request-users/badges
# Get friend request badge
1
GET
/app/friends/info
# Get friend info
1
POST
/app/friends/blocked-users/page
# Filter blocked friends
1
POST
/app/friends/search-users/page
# Search friends
1
POST
/app/friends/users/{user_id}/request
# Request friends
1
POST
/app/friends/users/{user_id}/accept
# Accept friends
1
POST
/app/friends/users/{user_id}/reject
# Reject friends
1
DELETE
/app/friends/users/{user_id}
# Remove friends
1
POST
/app/friends/users/{user_id}/block
# Block friends
1
DELETE
/app/friends/users/{user_id}/block
# Unblock friends
1
POST
/app/friends/users/{user_id}/permissions
# Set friend permission
1
GET
/app/friends/users/{user_id}/permissions
# Get friend permission
1
POST
/app/friends/default-permissions
# Set default friend permission
1
GET
/app/friends/default-permissions
# Get default friend permission
1
GET
/app/friends/users/{user_id}
# Get friend detail

Filter friends

This endpoint helps filter friends.

Request (FilterFriendReqDTO)

POST /app/friends/users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": ""
}

Response (FriendSummaryResDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"avatarUrl": "https://amazon.com/xxxxxx",
"nickname": "bill",
"username": "aritaone"
}
]
}
}

Filter friend requests

This endpoint helps filter friend requests.

Request (FilterFriendReqDTO)

POST /app/friends/request-users/page
{
"pagination": {
"page": 1,
"size": 10
},
"sortings": [],
"searchKey": ""
}

Response (FriendSummaryResDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"avatarUrl": "https://amazon.com/xxxxxx",
"nickname": "bill",
"username": "aritaone"
}
]
}
}

Get friend request badges

This endpoint helps get friend request badges.

Request

GET /app/friends/request-users/badges

Response (FriendRequestBadgeResDTO)

{
"success": true,
"message": "",
"data": {
"badge": 5
}
}

Get friend info

This endpoint helps get friend information.

Request

GET /app/friends/info

Response (FriendInfoResDTO)

{
"success": true,
"message": "",
"data": {
"requestBadge": 5,
"hasBlocked": true
}
}

Filter blocked friends

This endpoint helps filter blocked friends.

Request (FilterBlockedFriendReqDTO)

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

Response (BlockedFriendSummaryResDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"friendBlockId": "fdsgdhfh-404e-408e-90fb-e4d663fde7ba",
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"avatarUrl": "https://amazon.com/xxxxxx",
"nickname": "bill",
"username": "aritaone"
}
]
}
}

Search friends

This endpoint helps search friends.

Request (SearchUserFriendReqDTO)

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

Response (SearchUserFriendSummaryResDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"avatarUrl": "https://amazon.com/xxxxxx",
"nickname": "bill",
"username": "aritaone",
"friendActionType": 3
}
]
}
}

Request friends

This endpoint helps request friends.

Request

POST /app/friends/users/{user_id}/request

Response (RequestFriendResDTO)

{
"success": true,
"message": "",
"data": {
"friendActionType": 4
}
}

Accept friends

This endpoint helps accept friends.

Request

POST /app/friends/users/{user_id}/accept

Response

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

Reject friends

This endpoint helps reject friends.

Request

POST /app/friends/users/{user_id}/reject

Response (RejectFriendResDTO)

{
"success": true,
"message": "",
"data": {
"friendActionType": 4
}
}

Remove friends

This endpoint helps remove friends.

Request

DELETE /app/friends/users/{user_id}

Response

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

Block friends

This endpoint helps block friends.

Request

POST /app/friends/users/{user_id}/block

Response

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

Unblock friends

This endpoint helps unblock friends.

Request

DELETE /app/friends/users/{user_id}/block

Response

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

Set friend permission

This endpoint helps set friend permission.

Request (SetFriendPermissionReqDTO)

POST /app/friends/users/{user_id}/permissions
{
"stepView": true,
"mapView": true,
"mascotView": true,
"avatarView": true
}

Response

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

Get friend permission

This endpoint helps get friend permission.

Request

GET /app/friends/users/{user_id}/permissions

Response (FriendPermissionResDTO)

{
"success": true,
"message": "",
"data": {
"stepView": true,
"mapView": true,
"mascotView": true,
"avatarView": true
}
}

Set default friend permission

This endpoint helps set default friend permission.

Request (SetFriendDefaultPermissionReqDTO)

POST /app/friends/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 /app/friends/default-permissions

Response (FriendDefaultPermissionResDTO)

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

Get friend detail

This endpoint helps get friend detail.

Request

GET /app/friends/users/{user_id}

Response (FriendDetailResDTO)

{
"success": true,
"message": "",
"data": {
"userId": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"profile": {
"useAvatar": true,
"isDefaultAvatar": true,
"avatarUrl": "https://amazon.com/xxxxxx",
"shopItems": [
{
"id": "b2e745cb-4994-11ef-8cf0-7085c2d96f0d",
"name": "小耳",
"subcategoryId": 2,
"thumbnail": "https://jcci-test-media.aritaone.com/share/shop/伙伴角色/伙伴角色",
"riveInputName": "Character",
"riveInputValue": 0,
"coin": 0,
"isPurchased": false,
"isUsing": false,
"tag": null,
"purchasedAt": "2024-08-30T10:15:13.496221Z",
"birthdaySpecial": false,
"order": 10900,
"saleable": true,
"status": 1
}
]
},
"account": {
"username": "AritaOne",
"nickname": "Bill",
"district": "中西區"
},
"statistics": [
{
"id": 0,
"subItems": [
{
"subId": 0,
"section": {
"daily": {
"value": 0,
"subValue": 699963
},
"weekly": {
"value": 0,
"subValue": 699963
},
"monthly": {
"value": 0,
"subValue": 699963
},
"yearly": {
"value": 0,
"subValue": 699963
}
}
},
{
"subId": 0,
"value": 699963,
"subValue": 505775
}
]
}
]
}
}

Check user physique

This endpoint checks user physique.

Request

GET /app/friends/users/{user_id}/physique/check

Response (CheckPhysiqueResDTO)

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


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.

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
  • userId
    string
    The identifier of the user.
  • avatarUrl
    string
    The avatar of the user.
  • nickname
    string
    The nickname of the user.
  • username
    string
    The username of the user.

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.

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
  • friendBlockId
    string
    The identifier of the friend block relationship.
  • userId
    String
    The identifier of the user.
  • avatarUrl
    string
    The avatar of the user.
  • nickname
    string
    The nickname of the user.
  • username
    string
    The username of the user.

SearchUserFriendReqDTO

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.

SearchUserFriendSummaryResDTO

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.

SearchUserFriendSummaryItemResDTO

properties
  • userId
    string
    The identifier of the user.
  • avatarUrl
    string
    The avatar of the user.
  • nickname
    string
    The nickname of the user.
  • username
    string
    The username of the user.
  • friendActionType
    FriendActionType
    It is used to control the buttons. Please refer to the enum for detail.

RequestFriendResDTO

properties
  • friendActionType
    FriendActionType
    It is used to control the buttons. Please refer to the enum for detail.

RejectFriendResDTO

properties
  • friendActionType
    FriendActionType
    It is used to control the buttons. Please refer to the enum for detail.

SetFriendPermissionReqDTO

properties
  • 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.

FriendPermissionResDTO

properties
  • 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.

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.

FriendDetailResDTO

properties
  • userId
    string
    The identifier of the user.
  • profile
    FriendProfileDetailResDTO
    The profile and avatar of the user.
  • The account detail of the user.
  • The statistics of the user.

FriendAccountDetailResDTO

properties
  • username
    string
    用戶名稱
  • nickname
    string
    暱稱
  • district
    string
    所屬地區

FriendProfileDetailResDTO

properties
  • useAvatar
    boolean
    If it is true, use avatar url; if it is false, use mascot with costumes
  • isDefaultAvatar
    boolean
    If it is true, it means the avatar url is the default picture; if useAvatar is not true, please ignore this field.
  • avatarUrl
    string
    The avatar url of the user.
  • shopItems
    FriendShopDetailResDTO[]
    The using shop item of the user.

FriendProgressDetailResDTO

properties
  • friendId
    string
    The identifier of the friend relationship.
  • userId
    string
    The identifier of the user.
  • avatarUrl
    string
    The avatar of the user.
  • nickname
    string
    The nickname of the user.
  • username
    string
    The username of the user.

FriendShopDetailResDTO

properties
  • id
    string
    The id of the shop item.
  • name
    string
    The name id of the shop item.
  • subcategoryId
    Category
    required
    The subcategory id of the shop item.
  • thumbnail
    string
    The thumbnail url of the shop item.
  • riveInputName
    string
    The rive input name of the shop item.
  • riveInputValue
    number
    The rive input value of the shop item.
  • coin
    number
    The coin needed to purchase the shop item.
  • isPurchased
    Boolean
    It indicates if the shop item has been purchased or not.
  • isUsing
    Boolean
    It indicates if the shop item is currently being used by the user.
  • tag
    string
    The reserved tag for the shop item.
  • purchasedAt
    datetime
    The purchased time.
  • birthdaySpecial
    Boolean
    It indicates if the shop item is exclusive to the user in the birthday.
  • order
    number
    It is used by Backend for sorting.
  • saleable
    boolean
    It indicates if the item is saleable or not.
  • status
    number
    It is the status of the item. It is used by Backend team only and it may be removed in the future.

UserStatisticsItemResDTO

properties
  • id
    StatisticsEnum
    The identifier of the statistics item.
  • A list of sub-items

UserStatisticsSubItemResDTO

properties
  • subId
    StatisticsEnum
    The identifier of the statistics sub-item.
  • value
    number
    The corresponding values corrected to the nearest integer.
  • subValue
    number
    The corresponding values corrected to the nearest two decimal places.

FriendRequestBadgeResDTO

properties
  • badge
    number
    The number of the friend requests.

UserStatisticsSubItemSectionItemResDTO

properties
  • value
    number
    The corresponding values corrected to the nearest integer.
  • subValue
    number
    The corresponding values corrected to the nearest two decimal places.

UserStatisticsSubItemSectionResDTO

properties
  • daily
    UserStatisticsSubItemSectionItemResDTO
    The daily statistics.
  • The weekly statistics.
  • The monthly statistics.
  • The yearly statistics.

FriendInfoResDTO

properties
  • requestBadge
    number
    The number of the friend requests.
  • hasBlocked
    boolean
    It indicates if the user has blocked friends or not.

CheckPhysiqueResDTO

properties
  • check
    Boolean
    It returns true if physique is set; otherwise, it returns false.


PermissionEnum

NameValue
只有我0
僅親友可見1
所有人可見2

FriendActionType

NameValue
不可搜尋0
不可添加1
可添加2
已請求3
可接受/拒絕4