update_user_notification
To send an online notification to a user, use the command user/update_user_notification.
Creation
svc=user/update_user_notification¶ms={
"itemId":<long>, /*required*/
"callMode":"<text>", /*required*/
"h":"<text>", /*required*/
"d":"{ /*required*/
\"body\":\"<text>\",
\"head\":{
\"c\":<uint>,
\"fs\":\"<text>\"
},
\"multiple\":<int>
}",
"s":"<text>", /*required*/
"ttl":<uint> /*required*/
}
Deletion
svc=user/update_user_notification¶ms={
"itemId":<long>, /*required*/
"id":<long>, /*required*/
"callMode":"<text>", /*required*/
}
Parameters
The required parameters are marked with an asterisk (*).
Creation parameters
Name | Description |
---|---|
itemId* | User ID. |
callMode* | Action type (must be "create" for creation). |
h* | Subject. |
d* | Message text settings. |
body* | Text. |
с* | Colour, RGB. |
fs* | Font size. |
multiple* | Multiple activation: 1 - yes, 0 - no. |
s* | Sender. |
ttl* | Lifetime (UTC). When the lifetime expires, the notification will be deleted. |
Deletion parameters
Name | Description |
itemId* | User ID. |
id* | Notification ID. |
callMode* | Action type (must be "delete" for deletion). |
ImportantIf the ttl parameter indicates a date in the past, the notifications trigger only online (not stored on the server). The ttl parameter is a date in milliseconds from January 1, 1970.
Response
Response to creation:
[
<long>, /* notification ID */
{
"id":<long>, /* notification ID */
"t":<uint>, /* lifetime (UTC) */
"d":"<text>", /* message text settings*/
"h":"<text>", /* subject */
"s":"<text>" /* sender */
}
]
Response to deletion:
[
<long>, /* notification ID */
null
]
Error codes
Error code | Description |
---|---|
7 | Failed to fetch user with ACL (ADF_ACL_ITEM_EDIT_OTHER). |
6 | Failed to create/delete the notification. |
4 | Incorrect mode (must be "create" or "delete"). |