好友管理
请求加为好友
向其他用户发送好友申请。收件人将收到该请求的通知。
Request
Method : POST
POST
url : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/request
Header : 'content-type: application/json'
Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
data:
{
"userId": "80803902-8b83-4860-b8a6-xxxxxxxx",
"friendId": "a1c4aaa2-02f6-40bd-afb4-xxxxxxx",
"message": "做朋友吧!!"
}
Header
Type
Required
Description
X-API-KEY
String
O
GamePot发放的认证密钥
X-PROJECT-ID
String
O
仪表盘项目ID
Attribute
Type
Required
Description
userId
String
O
用户ID
friendId
String
O
添加好友ID
message
String
X
消息
Response
成功
{
"friendship": {
"project_id": "ec8231b2-6b20-4ad1-9c59-xxxxx",
"id": "5fe78d95-6186-4128-b52a-28759cxxxxxx",
"status": "requested",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id": "a1c4aaa2-02f6-40bd-afb4-b1d6caacf0de",
"requested_at": "2023-01-31T16:13:26-08:00"
}
}
Attribute
Type
Description
friendship.project_id
String
项目ID
friendship.id
String
输入ID
friendship.user_id
String
用户ID
friendship.status
String
状态
friendship.user_id
String
ID
friendship.user
Object
我的信息
friendship.friend_id
String
好友ID
friendship.friend
Object
好友信息
friendship.requested_at
String
请求日期
失败
{
"status": -1,
"message": "错误消息"
}
Attribute
Type
Description
code
Int
结果值(1:成功,失败时请参考Error code)
error
String
错误内容
同意好友申请
同意对方发送的好友申请。同意后两用户成为好友关系。
Request
Method : POST
POST
url : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/accept
Header : 'content-type: application/json'
Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
data:
{
"userId": "a1c4aaa2-02f6-40bd-afb4-xxxxxxxxx",
"friendId": "80803902-8b83-4860-b8a6-xxxxxxx"
}
Header
Type
Required
Description
X-API-KEY
String
O
GamePot发放的认证密钥
X-PROJECT-ID
String
O
仪表盘项目ID
Attribute
Type
Required
Description
userId
String
O
用户ID
friendId
String
O
添加好友ID
Response
成功
{
"friendship": {
"project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxx",
"id": "5fe78d95-6186-4128-b52a-xxxxxxxxx",
"status": "accepted",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id": "80803902-8b83-4860-b8a6-xxxxxxxxx",
"created_at": "2023-01-31T16:13:26-08:00",
"updated_at": "2023-01-31T16:13:26-08:00",
"requested_at": "2023-01-31T16:13:26-08:00"
}
}
Attribute
Type
Description
friendship.project_id
String
项目ID
friendship.id
String
输入ID
friendship.user_id
String
用户ID
friendship.status
String
状态
friendship.user_id
String
ID
friendship.friend_id
String
好友ID
friendship.user
Object
我的信息
friendship.friend
Object
好友信息
friendship.requested_at
String
请求日期
失败
{
"status": -1,
"message": "错误消息"
}
Attribute
Type
Description
code
Int
结果值(1:成功,失败时请参考Error code)
error
String
错误内容
拒绝好友
拒绝对方发来的好友申请。
Request
Method : POST
POST
url : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/reject
Header : 'content-type: application/json'
Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
data:
{
"userId": "a1c4aaa2-02f6-40bd-afb4-xxxxxxx",
"friendId": "80803902-8b83-4860-b8a6-xxxxxx"
}
Header
Type
Required
Description
X-API-KEY
String
O
GamePot发放的认证密钥
X-PROJECT-ID
String
O
仪表盘项目ID
Attribute
Type
Required
Description
userId
String
O
用户ID
friendId
String
O
添加好友ID
Response
成功
{
"friendship": {
"project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxx",
"id": "5fe78d95-6186-4128-b52a-xxxxxxxxx",
"status": "rejected",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id": "80803902-8b83-4860-b8a6-xxxxxxxxx",
"created_at": "2023-01-31T16:13:26-08:00",
"updated_at": "2023-01-31T16:13:26-08:00",
"requested_at": "2023-01-31T16:13:26-08:00"
}
}
Attribute
Type
Description
friendship.project_id
String
项目ID
friendship.id
String
输入ID
friendship.user_id
String
ID
friendship.friend_id
String
好友ID
friendship.status
String
状态
friendship.user
Object
我的信息
friendship.friend
Object
好友信息
friendship.requested_at
String
请求日期
失败
{
"status": -1,
"message": "错误消息"
}
Attribute
Type
Description
code
Int
结果值(1:成功,失败时参考错误代码)
error
String
错误内容
解除好友
此功能可以取消与其他用户的好友关系。解除好友功能是将相应用户在当事人的好友列表中移除。若当事人想再次与取消的好友成为好友关系,需要重新发送好友申请。
Request
Method : POST
DELETE
url : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship
Header : 'content-type: application/json'
Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
data:
{
"userId": "80803902-8b83-4860-b8a6-xxxxxx",
"friendId": "a1c4aaa2-02f6-40bd-afb4-xxxxxxx",
}
Header
Type
Required
Description
X-API-KEY
String
O
GamePot发放的认证密钥
X-PROJECT-ID
String
O
仪表盘项目ID
Attribute
Type
Required
Description
userId
String
O
用户ID
friendId
String
O
添加好友ID
Response
成功
{
"friendship": {
"project_id": "ec8231b2-6b20-4ad1-9c59-xxxxxx",
"id": "5fe78d95-6186-4128-b52a-xxxxxxxxx",
"status": "deleted",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"created_at": "2023-01-31T16:13:26-08:00",
"updated_at": "2023-01-31T16:13:26-08:00",
"requested_at": "2023-01-31T16:13:26-08:00"
}
}
Attribute
Type
Description
friendship.project_id
String
项目ID
friendship.id
String
输入ID
friendship.status
String
状态
friendship.user_id
String
ID
friendship.friend_id
String
好友ID
friendship.user
Object
我的信息
friendship.friend
Object
好友信息
friendship.requested_at
String
请求日期
失败
{
"status": -1,
"message": "错误消息"
}
Attribute
Type
Description
code
Int
结果值(1:成功,失败时请参考Error code)
error
String
错误内容
好友列表
显示当前好友列表。
Request
Method : GET
POST
url : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship?filter={"status":"accepted","user_id":"2d51cc68-a0d9-xxxxx-xxxx-xxxxxxxxxxxx"}
Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
Header
Type
Required
Description
X-API-KEY
String
O
GamePot发放的认证密钥
X-PROJECT-ID
String
O
仪表盘项目ID
Attribute
Type
Required
Description
filter
String
O
可通过过滤器搜索所有字段。
user_id
String
O
用户ID
过滤器可通过代码进行多种应用。 Status 可以根据代码搜索好友列表。
"accepted":已接受邀请成为好友的列表
"rejected":拒绝邀请的列表
"requested":请求交友的列表
"pending":已同意交友请求的列表
Response
成功
[
{
"project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
"id":"xxxxxxxxxxxxxxxxxxxx",
"status": "accepted",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"created_at": "2023-01-31T16:28:00-08:00",
"updated_at": "2023-01-31T16:28:03-08:00",
"requested_at": "2023-01-31T16:28:00-08:00"
},
{
"project_id": "ec8231b2-6b20-4ad1-9c59-8e183087a742",
"id":"xxxxxxxxxxxxxxxxxxxx",
"status": "accepted",
"user_id" : "xxxxxxxxxx",
"user": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"friend_id" : "xxxxxxxx",
"friend": {
"id": "xxxxxxxxxx",
"nickname": "xxxxxxxxxx"
},
"created_at": "2023-01-31T16:28:00-08:00",
"updated_at": "2023-01-31T16:28:03-08:00",
"requested_at": "2023-01-31T16:28:00-08:00"
}
]
Attribute
Type
Description
project_id
String
项目ID
id
String
固有ID
status
String
状态
user_id
String
ID
friend_id
String
好友ID
user
Object
我的信息
friend
Object
好友信息
created_at
String
创建日期
updated_at
String
更新日期
requested_at
String
请求日期
失败
{
"status": -1,
"message": "错误消息"
}
Attribute
Type
Description
code
Int
结果值(1:成功,失败时请参考Error code)
error
String
错误内容
Last updated