Classic/VPC 환경에서 이용 가능합니다.
다른 사용자가 보낸 친구 요청을 거절합니다.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
메서드 | URI |
---|---|
POST | /v1/api/friendship/reject |
요청 헤더
Ncloud Chat API에서 공통으로 사용하는 헤더에 대한 정보는 Ncloud Chat 요청 헤더를 참조해 주십시오.
요청 바디
요청 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
userId |
String | Required | 사용자 아이디
|
friendId |
String | Required | 친구 아이디
|
요청 예시
요청 예시는 다음과 같습니다.
curl --location --request POST 'https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship/reject' \
--header 'x-api-key: {API Key}' \
--header 'x-project-id: {Project ID}' \
--header 'Content-Type: application/json' \
--data '{
"userId": "a1c4aaa2-02f6-40bd-afb4-xxxxxxx",
"friendId": "80803902-8b83-4860-b8a6-xxxxxx"
}'
응답
응답 형식을 설명합니다.
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
friendship |
Object | - | 응답 결과 |
friendship.project_id |
String | - | 프로젝트 아이디 |
friendship.id |
String | - | 고유 아이디 |
friendship.status |
String | - | 요청 진행 상태 |
friendship.user_id |
String | - | 사용자 아이디 |
friendship.user |
Object | - | 사용자 정보 |
friendship.user.id |
String | - | 사용자 아이디 |
friendship.user.nickname |
String | - | 사용자 이름 |
friendship.friend_id |
String | - | 친구 아이디 |
friendship.friend |
Object | - | 친구 정보 |
friendship.friend.id |
String | - | 친구 아이디 |
friendship.friend.nickname |
String | - | 친구 이름 |
friendship.friend_id |
String | - | 친구 아이디 |
friendship.created_at |
String | - | 생성 일시
|
friendship.updated_at |
String | - | 정보 수정 일시
|
friendship.requested_at |
String | - | 친구 요청 일시
|
응답 상태 코드
Ncloud Chat API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Ncloud Chat 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
"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"
}
}