Subscription
- Print
- PDF
Subscription
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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.
Header | Description |
---|---|
x-project-id | Project ID that can be found in Dashboard > Settings > Project settings |
x-api-key | API key created in Dashboard > Settings > Project settings |
Request path parameters
The following parameter information is required for the API request.
Parameter | Type | Required | Description |
---|---|---|---|
filter | String | O | Pass the conditions you want to filter on as a JSON string. The default is {} . Filters allow you to search for specific fields |
sort | String | X | Define the sort criteria as a JSON string. For example, {"createdAt":"-1"} is in descending order and {"createdAt":"1"} is in ascending order |
option | String | X | Provide additional options as JSON strings |
Option information
Parameter | Type | Required | Description |
---|---|---|---|
offset | Number | X | Starting point of the list |
per_page | Number | X | Number of items to display per page |
count | Boolean | X | Return 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 code | Response Message | Description |
---|---|---|
200 | OK | Request processed successfully |
400 | Bad Request | It is returned if the request is invalid |
500 | Internal Server Error | It is returned if an internal server error has occurred |
Was this article helpful?