Subscription
    • PDF

    Subscription

    • PDF

    Article summary

    The following summarizes the API for getting subscription information and how to use it. This API is used to view subscription information for a channel.

    View subscription API

    This API retrieves a user's subscription information.

    Request URL

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

    Request headers

    The following headers are required in the request.

    HeaderDescription
    x-project-idProject ID that can be found in Dashboard > Settings > Project settings
    x-api-keyAPI key created in Dashboard > Settings > Project settings

    Request path parameters

    The following parameter information is required for the API request.

    ParameterTypeRequiredDescription
    filterStringOPass the conditions you want to filter on as a JSON string. The default is {}. Filters allow you to search for specific fields
    sortStringXDefine the sort criteria as a JSON string. For example, {"createdAt":"-1"} is in descending order and {"createdAt":"1"} is in ascending order
    optionStringXProvide additional options as JSON strings

    Option information

    ParameterTypeRequiredDescription
    offsetNumberXStarting point of the list
    per_pageNumberXNumber of items to display per page
    countBooleanXReturn total number instead of list

    Request example

    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'
    

    Response example (normal)

    The response returns a list of subscription information in a JSON array.

    [
      {
        "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
        }
      },
      ...
    ]
    

    Responses

    A response is returned with an HTTP status code.

    HTTP status codeResponse MessageDescription
    200OKRequest processed successfully
    400Bad RequestIt is returned if the request is invalid
    500Internal Server ErrorIt is returned if an internal server error has occurred

    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.