Friends
    • PDF

    Friends

    • PDF

    Article summary

    Manage friends

    Send friend request

    Send a friend request to another user. The recipient receives a notification of the request.

    Request

    • Method : POST
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship/request
    POST
    url : https://dashboard-api.ncloudchat.naverncp.com/v1/api/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": "Let's be friends!!"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    userIdStringOUser ID
    friendIdStringOFriend ID
    messageStringXMessage

    Response

    Success

    {
       "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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringProject ID
    friendship.idStringInput ID
    friendship.user_idStringUser ID
    friendship.statusStringStatus
    friendship.user_idStringID
    friendship.userObjectMy information
    friendship.friend_idStringFriend ID
    friendship.friendObjectFriend information
    friendship.requested_atStringRequest date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Accept friend request

    Accept another user's friend request. Upon acceptance, the users are connected as friends.

    Request

    • Method : POST
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship/accept
    POST
    url : https://dashboard-api.ncloudchat.naverncp.com/v1/api/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"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    userIdStringOUser ID
    friendIdStringOFriend ID

    Response

    Success

    {
       "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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringProject ID
    friendship.idStringInput ID
    friendship.user_idStringUser ID
    friendship.statusStringStatus
    friendship.user_idStringID
    friendship.friend_idStringFriend ID
    friendship.userObjectMy information
    friendship.friendObjectFriend information
    friendship.requested_atStringRequest date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Reject friend request

    Reject another user's friend request.

    Request

    • Method : POST
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship/reject
    POST
    url : https://dashboard-api.ncloudchat.naverncp.com/v1/api/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"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    userIdStringOUser ID
    friendIdStringOFriend ID

    Response

    Success

    {
       "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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringProject ID
    friendship.idStringInput ID
    friendship.user_idStringID
    friendship.friend_idStringFriend ID
    friendship.statusStringStatus
    friendship.userObjectMy information
    friendship.friendObjectFriend information
    friendship.requested_atStringRequest date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Unfriend

    This feature allows you to unfriend other users. Unfriending removes the user from your friend list. If you wish to become friends with the user again, you must send a new friend request.

    Request

    • Method : POST
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/friendship
    DELETE
    url : https://dashboard-api.ncloudchat.naverncp.com/v1/api/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",
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    userIdStringOUser ID
    friendIdStringOFriend ID

    Response

    Success

    {
       "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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringProject ID
    friendship.idStringInput ID
    friendship.statusStringStatus
    friendship.user_idStringID
    friendship.friend_idStringFriend ID
    friendship.userObjectMy information
    friendship.friendObjectFriend information
    friendship.requested_atStringRequest date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Friend list

    Displays the current friends list.

    Request

    • Method : GET
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/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'
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    filterStringOSearch is available for all fields of a query through filtering.
    user_idStringOUser ID

    Filters can be used in a variety of ways depending on the code.
    You can search for friends by status code.

    "accepted": a list of friends who have accepted to be your friend
    "rejected": a list of friends who have rejected your friend request
    "requested": a list of friends you have sent a friend request to
    "pending": a list of friends you have received a friend request from

    Response

    Success

    [
        {
            "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"
        }
    ]
    
    AttributeTypeDescription
    project_idStringProject ID
    idStringUnique ID
    statusStringStatus
    user_idStringID
    friend_idStringFriend ID
    userObjectMy information
    friendObjectFriend information
    created_atStringDate created
    updated_atStringDate updated
    requested_atStringRequest date

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Add friends in bulk

    You can save a list of multiple friends in bulk.

    Request

    • Method : GET
    • URI : https://dashboard-api.ncloudchat.naverncp.com/v1/api/v1/api/friendship/bulk
    POST
    url : https://dashboard-api.ncloudchat.naverncp.com/v1/api/v1/api/friendship/bulk
    Header 'x-api-key: 86dcgffae0xxxxxxxxxxxxxx'
    Header : 'x-project-id: ec8231b2-6b20-4ad1-xxxx-xxxxxxxxx'
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOAuthentication key issued by GAMEPOT
    X-PROJECT-IDStringODashboard project ID
    AttributeTypeRequiredDescription
    bodyStringOUser ID
    curl -X 'POST' \
      'http://localhost:4000/v1/api/friendship/bulk' \
      -H 'accept: application/json' \
      -H 'x-project-id: 339c2b1c-d35b-47f2-828d-5f02a130146a' \
      -H 'x-api-key: f0b1dfa4014035825cb3f55f88114a2516be89317eec7c37' \
      -H 'Content-Type: application/json' \
      -d '[
      {
        "userId": "osoriz",
        "friendId": "aginamoo"
      },
     {
        "userId": "osoriz",
        "friendId": "cat"
      },
     {
        "userId": "osoriz",
        "friendId": "peer"
      }
    ]'
    

    Response

    Success

    [
         {
        "userId": "osoriz",
        "friendId": "aginamoo"
      },
     {
        "userId": "osoriz",
        "friendId": "cat"
      },
     {
        "userId": "osoriz",
        "friendId": "peer"
      }
    ]
    
    AttributeTypeDescription
    userIdStringID
    friendIdStringFriend ID

    Failure

    {
        "status": -1,
        "message": "Error message"
    }
    
    AttributeTypeDescription
    codeIntResult value (1: success, refer to the error code in case of failure)
    errorStringError message

    Was this article helpful?

    What's Next
    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.