Available in Classic and VPC
Get channel subscription information of a user.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
GET | /v1/api/subscriptions |
Request headers
For information about the headers common to all Ncloud Chat APIs, see Ncloud Chat request headers.
Request query parameters
You can use the following query parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
filter |
String | Required | Filtering criteria
|
sort |
String | Optional | Sort by
|
option |
String | Optional | Additional options: Option
|
Option
The following describes Option.
Field | Type | Required | Description |
---|---|---|---|
offset |
Number | Optional | Query start offset
|
per_page |
Number | Optional | Number of items per page
|
count |
Boolean | Optional | Whether to display the number of response results instead of a list
|
Request example
The request example is as follows:
curl --location --request GET 'https://dashboard-api.ncloudchat.naverncp.com/v1/api/subscriptions
?filter=%7B%22user_id%22%3A%22NCP001%22%7D
&sort=%7B%22created_at%22%3A%22-1%22%7D
&option=%7B%22offset%22%3A0%2C%22per_page%22%3A20%7D' \
--header 'x-api-key: {API Key}' \
--header 'x-project-id: {Project ID}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
id |
String | - | Subscription unique ID |
project_id |
String | - | Project ID |
channel_id |
String | - | Channel ID |
user_id |
String | - | User ID |
online |
Boolean | - | Online status
|
language |
String | - | Language |
push |
Boolean | - | Whether to allow push notifications
|
mute |
Boolean | - | Whether to mute channel
|
user |
Object | - | User information |
user.name |
String | - | User name |
user.profile |
String | - | User profile image |
mark |
Object | - | Last message information |
mark.user_id |
String | - | Sender ID |
mark.message_id |
String | - | Message ID |
mark.sort_id |
String | - | Delivery date and time
|
mark.unread |
String | - | Number of unread messages since |
Response status codes
For information about the HTTP status codes common to all Ncloud Chat APIs, see Common Ncloud Chat response status codes.
Response example
The response example is as follows:
[
{
"id": "78e6d8ca-****-****-****-6ebe51af5906",
"project_id": "8be54b8b-****-****-****-84c0d5df2e9c",
"channel_id": "17563b23-****-****-****-de11ce1ff34a",
"user_id": "NCP001",
"online": false,
"language": "",
"push": true,
"mute": false,
"user": {
"name": "Baby tree",
"profile": ""
},
"mark": {
"user_id": "NCP001",
"message_id": "66a04**********b5b4d9e10",
"sort_id": "1721780063170",
"unread": 117
}
},
{
"id": "4fed04e9-****-****-****-dcd4c180079c",
"project_id": "8be54b8b-****-****-****-84c0d5df2e9c",
"channel_id": "a7adab41-****-****-****-961f661dcefd",
"user_id": "NCP001",
"online": false,
"language": "",
"push": true,
"mute": false,
"user": {
"name": "Baby tree",
"profile": ""
},
"mark": {
"user_id": "NCP001",
"message_id": "",
"sort_id": "",
"unread": 24
}
}
]