친구관리
친구 요청
다른 유저에게 친구 요청을 전송합니다. 수신자는 해당 요청에 대해 알림을 받습니다.
Request
- Method : POST
- URI : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/request
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 |
대시보드 프로젝트 아이디 |
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 |
아이디 |
friendship.user |
Object |
내 정보 |
friendship.friend_id |
String |
친구 아이디 |
friendship.friend |
Object |
친구 정보 |
friendship.requested_at |
String |
요청일 |
실패
{
"status": -1,
"message": "오류 메시지"
}
Attribute |
Type |
Description |
code |
Int |
결과 값 (1: 성공, 실패 시 Error code 참고) |
error |
String |
오류 내용 |
친구 수락
상대방이 보낸 친구 요청을 수락합니다. 수락 후 두 유저는 친구 관계로 연결됩니다.
Request
- Method : POST
- URI : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/accept
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 |
대시보드 프로젝트 아이디 |
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 |
아이디 |
friendship.friend_id |
String |
친구 아이디 |
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
- URI : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship/reject
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 |
대시보드 프로젝트 아이디 |
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 |
아이디 |
friendship.friend_id |
String |
친구 아이디 |
friendship.status |
String |
상태 |
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
- URI : https://gamepot.apigw.ntruss.com/gpapps/v2/friendship
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 |
대시보드 프로젝트 아이디 |
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 |
아이디 |
friendship.friend_id |
String |
친구 아이디 |
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
- URI : https://gamepot.apigw.ntruss.com/gpapps/v2/friendships?filter={"status":"accepted","user_id":"2d51cc68-a0d9-xxxxx-xxxx-xxxxxxxxxxxx"}
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 |
대시보드 프로젝트 아이디 |
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 |
아이디 |
friend_id |
String |
친구 아이디 |
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 |
오류 내용 |