Classic/VPC 환경에서 이용 가능합니다.
다른 사용자에게 친구 요청을 전송합니다. 요청을 수신한 사용자는 알림을 통해 요청 내역을 확인할 수 있습니다.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
| 메서드 | URI | 
|---|---|
| POST | /v1/api/friendship/request | 
요청 헤더
Ncloud Chat API에서 공통으로 사용하는 헤더에 대한 정보는 Ncloud Chat 요청 헤더를 참조해 주십시오.
요청 바디
요청 바디에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 | 
|---|---|---|---|
userId | 
String | Required | 사용자 아이디
  | 
friendId | 
String | Required | 친구 아이디
  | 
message | 
String | Optional | 친구 요청 메시지 | 
요청 예시
요청 예시는 다음과 같습니다.
curl --location --request POST 'https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship/request' \
--header 'x-api-key: {API Key}' \
--header 'x-project-id: {Project ID}' \
--header 'Content-Type: application/json' \
--data '{
            "userId": "guestID2",
            "friendId": "user_5",
            "message": "You are requested."
}'
응답
응답 형식을 설명합니다.
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 | 
|---|---|---|---|
data.requestFriend.friendship | 
Object | - | 친구 요청 정보 | 
data.requestFriend.friendship.project_id | 
String | - | 프로젝트 아이디 | 
data.requestFriend.friendship.id | 
String | - | 고유 아이디 | 
data.requestFriend.friendship.status | 
String | - | 요청 진행 상태 | 
data.requestFriend.friendship.user_id | 
String | - | 사용자 아이디 | 
data.requestFriend.friendship.user | 
Object | - | 사용자 정보 | 
data.requestFriend.friendship.user.id | 
String | - | 사용자 아이디 | 
data.requestFriend.friendship.user.name | 
String | - | 사용자 이름 | 
data.requestFriend.friendship.user.profile | 
String | - | 사용자 프로필 이미지 | 
data.requestFriend.friendship.friend | 
Object | - | 친구 정보 | 
data.requestFriend.friendship.friend.id | 
String | - | 친구 아이디 | 
data.requestFriend.friendship.friend.name | 
String | - | 친구 이름 | 
data.requestFriend.friendship.friend.profile | 
String | - | 친구 프로필 이미지 | 
data.requestFriend.friendship.friend_id | 
String | - | 친구 아이디 | 
data.requestFriend.friendship.created_at | 
String | - | 생성 일시
  | 
data.requestFriend.friendship.updated_at | 
String | - | 정보 수정 일시
  | 
data.requestFriend.friendship.requested_at | 
String | - | 친구 요청 일시
  | 
응답 상태 코드
Ncloud Chat API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Ncloud Chat 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
    "data": {
        "requestFriend": {
            "friendship": {
                "project_id": "8be54b8b-*****-****-****-84c0d5df2e9c",
                "id": "58478769-****-****-****-8cff6c4a5d75",
                "status": "requested",
                "user_id": "d71157d7-****-****-****-3c4cd4fef46e",
                "user": {
                    "id": "TWVtYmVy****************************************ZDRmZWY0NmU=",
                    "name": "Admin",
                    "profile": ""
                },
                "friend": {
                    "id": "TWVt**********VyXzU=",
                    "name": "a",
                    "profile": ""
                },
                "friend_id": "user_5",
                "created_at": null,
                "updated_at": null,
                "requested_at": "2025-07-24T13:58:23+09:00"
            }
        }
    }
}