POST DeviceSubscriptions/Post
Register a device token in the notification system
Request Information
URI Parameters
None.
Body Parameters
DeviceSubscriptionViewModel| Name | Description | Type | Additional information |
|---|---|---|---|
| Id |
the actual ID of the device subscription in the database (usually not required) |
integer |
None. |
| DeviceToken |
The device toekn |
string |
Required |
| UserId |
UserId |
string |
None. |
| LoginName |
login name (declared by the app), in case the api is configured without authentication |
string |
None. |
| BadgeCount |
badge count |
integer |
None. |
| IsActive |
true means the device is active |
boolean |
None. |
| IsRegistrated |
true means the device is already registered in Azure |
boolean |
None. |
| isDoNotDisturb |
true -> device has enabled 'do not disturb' |
boolean |
None. |
| DoNotDisturbStart |
datetime start of the do not disturb time range (UTC) |
date |
None. |
| DoNotDisturbEnd |
datetime end of the do not disturb time range (UTC) |
date |
None. |
| NotificationSetting |
Notification settings |
NotificationSettings |
None. |
| System |
Must be "apple" or "gcm" (or another Azure valid notification system), default is apple |
string |
None. |
| Guid |
a GUID that is generated by the notification service in order to use TAG notification in azure. |
string |
None. |
| TimeZoneInfo |
TimeZoneInfo (ex : Europe/Paris) |
string |
None. |
Request Formats
application/json, text/json
{
"Id": 1,
"DeviceToken": "sample string 2",
"UserId": "sample string 3",
"LoginName": "sample string 4",
"BadgeCount": 1,
"IsActive": true,
"IsRegistrated": true,
"isDoNotDisturb": true,
"DoNotDisturbStart": "2026-10-05T12:01:47.5952678+00:00",
"DoNotDisturbEnd": "2026-10-05T12:01:47.5957796+00:00",
"NotificationSetting": 0,
"System": "sample string 8",
"Guid": "sample string 9",
"TimeZoneInfo": "sample string 10"
}
application/xml, text/xml
<DeviceSubscriptionViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CGI.MPulse.DeviceRegistration.Models"> <BadgeCount>1</BadgeCount> <DeviceToken>sample string 2</DeviceToken> <DoNotDisturbEnd>2026-10-05T12:01:47.5957796+00:00</DoNotDisturbEnd> <DoNotDisturbStart>2026-10-05T12:01:47.5952678+00:00</DoNotDisturbStart> <Guid>sample string 9</Guid> <Id>1</Id> <IsActive>true</IsActive> <IsRegistrated>true</IsRegistrated> <LoginName>sample string 4</LoginName> <NotificationSetting>None</NotificationSetting> <System>sample string 8</System> <TimeZoneInfo>sample string 10</TimeZoneInfo> <UserId>sample string 3</UserId> <isDoNotDisturb>true</isDoNotDisturb> </DeviceSubscriptionViewModel>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
DeviceHandle| Name | Description | Type | Additional information |
|---|---|---|---|
| DeviceToken | string |
None. |
|
| IsActive | boolean |
None. |
|
| UserId | string |
None. |
|
| BadgeCount | integer |
None. |
|
| LoginName | string |
None. |
|
| Guid | string |
None. |
|
| isDoNotDisturb | boolean |
None. |
|
| DoNotDisturbStart | date |
None. |
|
| DoNotDisturbEnd | date |
None. |
|
| NotificationSetting | NotificationSettings |
None. |
|
| System | string |
None. |
|
| IsRegistrated | boolean |
None. |
|
| TimeZoneInfo | string |
None. |
|
| CreatedDate | date |
None. |
|
| CreatedBy | string |
None. |
|
| UpdatedDate | date |
None. |
|
| UpdatedBy | string |
None. |
|
| Id | integer |
None. |
Response Formats
application/json, text/json
{
"DeviceToken": "sample string 1",
"IsActive": true,
"UserId": "sample string 3",
"BadgeCount": 4,
"LoginName": "sample string 5",
"Guid": "sample string 6",
"isDoNotDisturb": true,
"DoNotDisturbStart": "2026-10-05T12:01:47.7545372+00:00",
"DoNotDisturbEnd": "2026-10-05T12:01:47.7545372+00:00",
"NotificationSetting": 0,
"System": "sample string 8",
"IsRegistrated": true,
"TimeZoneInfo": "sample string 10",
"CreatedDate": "2026-10-05T12:01:47.7565762+00:00",
"CreatedBy": "sample string 12",
"UpdatedDate": "2026-10-05T12:01:47.7565762+00:00",
"UpdatedBy": "sample string 14",
"Id": 15
}
application/xml, text/xml
<DeviceHandle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CGI.MPulse.Domain.Models"> <Id>15</Id> <CreatedBy>sample string 12</CreatedBy> <CreatedDate>2026-10-05T12:01:47.7565762+00:00</CreatedDate> <UpdatedBy>sample string 14</UpdatedBy> <UpdatedDate>2026-10-05T12:01:47.7565762+00:00</UpdatedDate> <BadgeCount>4</BadgeCount> <DeviceToken>sample string 1</DeviceToken> <DoNotDisturbEnd>2026-10-05T12:01:47.7545372+00:00</DoNotDisturbEnd> <DoNotDisturbStart>2026-10-05T12:01:47.7545372+00:00</DoNotDisturbStart> <Guid>sample string 6</Guid> <IsActive>true</IsActive> <IsRegistrated>true</IsRegistrated> <LoginName>sample string 5</LoginName> <NotificationSetting>None</NotificationSetting> <System>sample string 8</System> <TimeZoneInfo>sample string 10</TimeZoneInfo> <UserId>sample string 3</UserId> <isDoNotDisturb>true</isDoNotDisturb> </DeviceHandle>