MENU
      친구관리
        • PDF

        친구관리

        • PDF

        기사 요약

        친구관리

        친구 요청

        다른 유저에게 친구 요청을 전송합니다. 수신자는 해당 요청에 대해 알림을 받습니다.

        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": "친구 합시다!!"
        }
        JavaScript
        HeaderTypeRequiredDescription
        X-API-KEYStringOGamePot에서 발급하는 인증 키
        X-PROJECT-IDStringO대시보드 프로젝트 아이디
        AttributeTypeRequiredDescription
        userIdStringO사용자ID
        friendIdStringO친구추가ID
        messageStringX메시지

        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"
            }
        }
        JavaScript
        AttributeTypeDescription
        friendship.project_idString프로젝트ID
        friendship.idString입력ID
        friendship.user_idString사용자ID
        friendship.statusString상태
        friendship.user_idString아이디
        friendship.userObject내 정보
        friendship.friend_idString친구 아이디
        friendship.friendObject친구 정보
        friendship.requested_atString요청일

        실패

        {
            "status": -1,
            "message": "오류 메시지"
        }
        JavaScript
        AttributeTypeDescription
        codeInt결과 값 (1: 성공, 실패 시 Error code 참고)
        errorString오류 내용

        친구 수락

        상대방이 보낸 친구 요청을 수락합니다. 수락 후 두 유저는 친구 관계로 연결됩니다.

        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"
        }
        JavaScript
        HeaderTypeRequiredDescription
        X-API-KEYStringOGamePot에서 발급하는 인증 키
        X-PROJECT-IDStringO대시보드 프로젝트 아이디
        AttributeTypeRequiredDescription
        userIdStringO사용자ID
        friendIdStringO친구추가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"
            }
        }
        JavaScript
        AttributeTypeDescription
        friendship.project_idString프로젝트ID
        friendship.idString입력ID
        friendship.user_idString사용자ID
        friendship.statusString상태
        friendship.user_idString아이디
        friendship.friend_idString친구 아이디
        friendship.userObject내 정보
        friendship.friendObject친구 정보
        friendship.requested_atString요청일

        실패

        {
            "status": -1,
            "message": "오류 메시지"
        }
        JavaScript
        AttributeTypeDescription
        codeInt결과 값 (1: 성공, 실패 시 Error code 참고)
        errorString오류 내용

        친구 거절

        상대방이 보낸 친구 요청을 거절합니다.

        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"
        }
        JavaScript
        HeaderTypeRequiredDescription
        X-API-KEYStringOGamePot에서 발급하는 인증 키
        X-PROJECT-IDStringO대시보드 프로젝트 아이디
        AttributeTypeRequiredDescription
        userIdStringO사용자ID
        friendIdStringO친구추가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"
            }
        }
        JavaScript
        AttributeTypeDescription
        friendship.project_idString프로젝트ID
        friendship.idString입력ID
        friendship.user_idString아이디
        friendship.friend_idString친구 아이디
        friendship.statusString상태
        friendship.userObject내 정보
        friendship.friendObject친구 정보
        friendship.requested_atString요청일

        실패

        {
            "status": -1,
            "message": "오류 메시지"
        }
        JavaScript
        AttributeTypeDescription
        codeInt결과값 (1: 성공, 실패 시 Error code 참고)
        errorString오류 내용

        친구 끊기

        타 유저들과의 친구 관계를 끊을 수 있는 기능입니다. 친구 끊기는 당사자의 친구 목록에서 해당 유저를 제거시킵니다. 당사자가 끊어진 친구와 다시 친구 관계를 맺고 싶을 경우 새롭게 친구 요청을 전송해야 합니다.

        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",
        }
        JavaScript
        HeaderTypeRequiredDescription
        X-API-KEYStringOGamePot에서 발급하는 인증 키
        X-PROJECT-IDStringO대시보드 프로젝트 아이디
        AttributeTypeRequiredDescription
        userIdStringO사용자ID
        friendIdStringO친구추가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"
            }
        }
        JavaScript
        AttributeTypeDescription
        friendship.project_idString프로젝트ID
        friendship.idString입력ID
        friendship.statusString상태
        friendship.user_idString아이디
        friendship.friend_idString친구 아이디
        friendship.userObject내 정보
        friendship.friendObject친구 정보
        friendship.requested_atString요청일

        실패

        {
            "status": -1,
            "message": "오류 메시지"
        }
        JavaScript
        AttributeTypeDescription
        codeInt결과 값 (1: 성공, 실패 시 Error code 참고)
        errorString오류 내용

        친구 목록

        현재 친구 목록을 보여줍니다.

        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'
        JavaScript
        HeaderTypeRequiredDescription
        X-API-KEYStringOGamePot에서 발급하는 인증 키
        X-PROJECT-IDStringO대시보드 프로젝트 아이디
        AttributeTypeRequiredDescription
        filterStringO쿼리를 필터 모든 필드에 대해서 검색이 가능합니다.
        user_idStringO사용자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"
            }
        ]
        JavaScript
        AttributeTypeDescription
        project_idString프로젝트ID
        idString고유ID
        statusString상태
        user_idString아이디
        friend_idString친구 아이디
        userObject내 정보
        friendObject친구 정보
        created_atString생성일
        updated_atString업데이트일
        requested_atString요청일

        실패

        {
            "status": -1,
            "message": "오류 메시지"
        }
        JavaScript
        AttributeTypeDescription
        codeInt결과 값 (1: 성공, 실패 시 Error code 참고)
        errorString오류 내용

        이 문서가 도움이 되었습니까?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.