友達の管理
    • PDF

    友達の管理

    • PDF

    Article Summary

    友達管理

    友達リクエスト

    他のユーザーに友達リクエストを送信します。受信者はそのリクエストの通知を受け取ります。

    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": "友達になりましょう!!"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOGamePotで発行する認証キー
    X-PROJECT-IDStringOダッシュボードプロジェクト ID
    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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringプロジェクト ID
    friendship.idString入力 ID
    friendship.user_idStringユーザー ID
    friendship.statusString状態
    friendship.user_idStringID
    friendship.userObjectマイ情報
    friendship.friend_idString友達 ID
    friendship.friendObject友達情報
    friendship.requested_atStringリクエスト日

    失敗

    {
        "status": -1,
        "message": "エラーメッセージ"
    }
    
    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"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOGamePotで発行する認証キー
    X-PROJECT-IDStringOダッシュボードプロジェクト ID
    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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringプロジェクト ID
    friendship.idString入力 ID
    friendship.user_idStringユーザー ID
    friendship.statusString状態
    friendship.user_idStringID
    friendship.friend_idString友達 ID
    friendship.userObjectマイ情報
    friendship.friendObject友達情報
    friendship.requested_atStringリクエスト日

    失敗

    {
        "status": -1,
        "message": "エラーメッセージ"
    }
    
    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"
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOGamePotで発行する認証キー
    X-PROJECT-IDStringOダッシュボードプロジェクト ID
    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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringプロジェクト ID
    friendship.idString入力 ID
    friendship.user_idStringID
    friendship.friend_idString友達 ID
    friendship.statusString状態
    friendship.userObjectマイ情報
    friendship.friendObject友達情報
    friendship.requested_atStringリクエスト日

    失敗

    {
        "status": -1,
        "message": "エラーメッセージ"
    }
    
    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",
    }
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOGamePotで発行する認証キー
    X-PROJECT-IDStringOダッシュボードプロジェクト ID
    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"
        }
    }
    
    AttributeTypeDescription
    friendship.project_idStringプロジェクト ID
    friendship.idString入力 ID
    friendship.statusString状態
    friendship.user_idStringID
    friendship.friend_idString友達 ID
    friendship.userObjectマイ情報
    friendship.friendObject友達情報
    friendship.requested_atStringリクエスト日

    失敗

    {
        "status": -1,
        "message": "エラーメッセージ"
    }
    
    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'
    
    HeaderTypeRequiredDescription
    X-API-KEYStringOGamePotで発行する認証キー
    X-PROJECT-IDStringOダッシュボードプロジェクト ID
    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"
        }
    ]
    
    AttributeTypeDescription
    project_idStringプロジェクト ID
    idString固有 ID
    statusString状態
    user_idStringID
    friend_idString友達 ID
    userObjectマイ情報
    friendObject友達情報
    created_atString作成日
    updated_atStringアップデート日
    requested_atStringリクエスト日

    失敗

    {
        "status": -1,
        "message": "エラーメッセージ"
    }
    
    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.