MENU
      サブスクリプション

        サブスクリプション


        記事の要約

        こちらは、サブスクリプション情報を照会するための APIの説明と使用方法のまとめです。この APIは、チャンネルのサブスクリプション情報を照会するのに用いられます。

        サブスクリプション照会 API

        この APIは、ユーザーのサブスクリプション情報を照会します。

        リクエスト URL

        GET https://dashboard-api.ncloudchat.naverncp.com/v1/api/subscriptions
        Plain text

        リクエストヘッダ

        リクエストに必要なヘッダは次の通りです。

        HeaderDescription
        x-project-idダッシュボード > 設定 > プロジェクトの設定で検索可能なプロジェクト ID
        x-api-keyダッシュボード > 設定 > プロジェクトの設定で作成された API Key

        リクエストパスパラメータ

        API呼び出し時に必要なパラメータ情報は次の通りです。

        パラメータタイプ必須の有無説明
        filterStringOフィルタリングする条件を JSON文字列で渡します。デフォルトは{}です。フィルタは、特定のフィールドに対して検索を行えます。
        sortStringXソート基準を JSON文字列で定義します。例えば、{"createdAt":"-1"}は降順、{"createdAt":"1"}は昇順です。
        optionStringX追加オプションを JSON文字列で提供します。

        Optionの案内

        パラメータタイプ必須の有無説明
        offsetNumberXリストの先頭
        per_pageNumberXページごとに表示する項目数
        countBooleanXリストの代わりに総数を返す

        リクエスト例

        curl -X 'GET' \
          'https://dashboard-api.ncloudchat.naverncp.com/v1/api/subscriptions?filter=%7B%22online%22%3Atrue%7D' \
          -H 'accept: application/json' \
          -H 'x-project-id: 339c2b1c-d35b-47f2-828d-xxxxxxxxx' \
          -H 'x-api-key: 4302925661f70ce7c14xxxxxxxxxxxxxxxxxxxx'
        Plain text

        レスポンス例(正常)

        レスポンスは、サブスクリプション情報リストを JSON配列の形式で返します。

        [
          {
            "id": "5dd63a13-dad6-4a22-8a6c-xxxxxx",
            "project_id": "339c2b1c-d35b-47f2-828d-xxxxxx",
            "channel_id": "45ee8860-fa76-4861-9dc0-xxxxxx",
            "user_id": "userId",
            "online": true,
            "language": "en",
            "push": true,
            "mute": false,
            "user": {
              "name": "nickname_576976",
              "profile": "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=25"
            },
            "mark": {
              "user_id": null,
              "message_id": null,
              "sort_id": null,
              "unread": null
            }
          },
          ...
        ]
        Plain text

        レスポンス

        HTTPステータスコードとともにレスポンスが返されます。

        HTTPステータスコードレスポンスメッセージ説明
        200OKリクエストの処理に成功
        400Bad Request無効なリクエストの場合に返す
        500Internal Server Errorサーバ内部エラーが発生した場合に返す

        この記事は役に立ちましたか?

        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.