-
Notifications
You must be signed in to change notification settings - Fork 1
System Notification
Borja Gorriz edited this page Sep 23, 2013
·
3 revisions
This method is a LongPolling async method to obtain the notifications generated on the PS in “near real-time”. The request can be by user and by different devices to open a longpolling session. The push message will arrive on all the session opened.
Call: https://dime-communications/push/{said_hoster}/{id_device}/@comet
Parameters:
- said_hoster=SERVICE_ACCOUNT_ID
- id_device=DEVICE_GUID
Examples:
- Call: api/dime/push/5b223cde-07e5-4987-b531-231876fa7601/device-001/@comet
- Response:
{
"response": {
"meta": {
"v": "1.0",
"status": "OK",
"code": 200,
"timeRef": 1366033798903,
"msg": "OK"
},
"data": {
"startIndex": 0,
"itemsPerPage": 1,
"totalResults": 1,
"entry": [
{
"guid": "<uniqueId>", // System notification
"type": "notification",
"created": 1366033798903,
"operation": "<create|update|remove>",
"element": {
"guid": "<guid_of_element",
"type": "<type_of_element>",
"userId": "<userId_related_to_element>" //"person_guid" or "@me"
}
}
]
}
}
}Base URL: api/dime/rest/{mainSaId}/notification
| Method | Path | Description |
| GET | @me/@all | Returns a collection of all notifications the user has received. |
| GET | @me/byDate?from=<long_time_in_millis>&to=<long_time_in_millis> | Returns a collection between dates |
| GET | @me/{Ntid} | Returns a specific notification. |
Parameters:
- Ntid: Id of an specific notification.
Examples:
- Call: api/dime/rest/5b223cde-07e5-4987-b531-231876fa7601/notification/@me/@all
- Response:
{
"response": {
"meta": {
"v": "1.0",
"status": "OK",
"code": 200,
"timeRef": 1366033798903,
"msg": "OK"
},
"data": {
"startIndex": 0,
"itemsPerPage": 1,
"totalResults": 1,
"entry": [
{
"guid": "<uniqueId>", // System notification
"type": "notification",
"created": 1366033798903,
"operation": "<create|update|remove>",
"element": {
"guid": "<guid_of_element",
"type": "<type_of_element>",
"userId": "<userId_related_to_element>" //"person_guid" or "@me"
}
}
]
}
}
}