Available in Classic and VPC
Set up push notifications for a user.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /v1/api/members/{userId}/notification |
Request headers
For information about the headers common to all Ncloud Chat APIs, see Ncloud Chat request headers.
Request path parameters
You can use the following path parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
userId |
String | Required | User ID
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
token |
String | Optional | Push token |
device |
String | Optional | Device push type
|
os |
String | Optional | Operating system version |
push |
Boolean | Optional | Whether to allow push notifications
|
ad |
Boolean | Optional | Whether to allow ad push notifications
|
night |
Boolean | Optional | Whether to allow night push notifications
|
timezone |
String | Optional | Time zone |
Request example
The request example is as follows:
curl --location --request POST 'https://dashboard-api.ncloudchat.naverncp.com/v1/api/members/39c8de0f-****-****-****-6a1a875df59f/notification' \
--header 'x-api-key: {API Key}' \
--header 'x-project-id: {Project ID}' \
--header 'Content-Type: application/json' \
--data '{
"token": "dXNhZ2******************************YWJjZGVm",
"device": "APNS",
"os": "iOS 18",
"push": true,
"ad": true,
"night": true,
"timezone": "Asia/Seoul"
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
member |
Object | - | User information |
member.id |
String | - | User ID |
member.notifications |
Object | - | Push notification settings |
member.notifications.token |
String | - | Push token |
member.notifications.device |
String | - | Device push type
|
member.notifications.os |
String | - | Operating system version |
member.notifications.push |
Boolean | - | Whether to allow push notifications
|
member.notifications.ad |
Boolean | - | Whether to allow ad push notifications
|
member.notifications.night |
Boolean | - | Whether to allow night push notifications
|
member.notifications.timezone |
String | - | Time zone
|
status |
Integer | - | Response status
|
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:
{
"member": {
"id": "39c8de0f-****-****-****-6a1a875df59f",
"notifications": {
"token": "dXNhZ2******************************YWJjZGVm",
"device": "APNS",
"os": "iOS 18",
"push": true,
"ad": true,
"night": true,
"timezone": null
}
},
"status": 1
}