Available in Classic and VPC
Reject a friend request from another user.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /v1/api/friendship/reject |
Request headers
For information about the headers common to all Ncloud Chat APIs, see Ncloud Chat request headers.
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
userId |
String | Required | User ID
|
friendId |
String | Required | Friend ID
|
Request example
The request example is as follows:
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"
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
friendship |
Object | - | Response result |
friendship.project_id |
String | - | Project ID |
friendship.id |
String | - | Unique ID |
friendship.status |
String | - | Request progress status |
friendship.user_id |
String | - | User ID |
friendship.user |
Object | - | User information |
friendship.user.id |
String | - | User ID |
friendship.user.nickname |
String | - | User name |
friendship.friend_id |
String | - | Friend ID |
friendship.friend |
Object | - | Friend information |
friendship.friend.id |
String | - | Friend ID |
friendship.friend.nickname |
String | - | Friend name |
friendship.friend_id |
String | - | Friend ID |
friendship.created_at |
String | - | Creation date and time
|
friendship.updated_at |
String | - | Information modification date and time
|
friendship.requested_at |
String | - | Friend request date and time
|
Response status codes
For information about the HTTP status codes common to all Ncloud Chat APIs, see Common Ncloud Chat response status codes.
Response example
The response example is as follows:
{
"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"
}
}