List notifications history
Purpose
This endpoint provides a history of notifications. As notification history entries have a TTL of 7 days, you cannot check further back in the history. The list is sorted from the freshest to the oldest.
Request data
HTTPS method: GET
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL request format
https://{baseURL}/notifications/{versionNumber}/history?key={Your_API_Key}&from={timestamp}&to={timestamp}&maxResults={integer}&pageNumber={integer}
curl command request format
curl 'https://{baseURL}/notifications/{versionNumber}/history?key={Your_API_Key}&from={timestamp}&to={timestamp}&maxResults={integer}&pageNumber={integer}'
Request parameters
The following table describes the parameters that can be used in a request.
- Required parameters must be used or the call will fail.
- Optional parameters may be used.
- The order of request parameters is not important.
Required parameters | Description |
---|---|
string | The base URL for calling the API. Value: |
string | Service version. Value: |
string | An API Key valid for the requested service. Value: Your valid |
timestamp | Beginning date for the listing. Value: ISO 8601 format timestamp with the accuracy of seconds (YYYY-MM-DDThh:mm:ss). |
Optional parameters | Description |
---|---|
timestamp | End date for the listing. Value: ISO 8601 format timestamp with the accuracy of seconds (YYYY-MM-DDThh:mm:ss). |
integer | Maximum number of items returned in the response. Value: Greater than zero, less than or equal to 100. Default: |
integer | The number of items on the page to be returned in the response. The maximum number of elements on the page is equal to the maxResult value. Value: Greater than zero. Default: |
Response data
Response body
1{2 "summary": {3 "from": "ISO8601_timestamp",4 "to": "ISO8601_timestamp"5 },6 "notifications": [{7 "title": "message title",8 "body": "message body",9 "contact": {10 "type": "contact_type",11 "value": "contact"12 },13 "status": {14 "type": "status_type",15 "details": "status_details"16 },17 "sendDate": "creation_timestamp"18 },19 ...20 ],21 "resultInfo": {22 "maxResults": 100,23 "pageNumber": 1,24 "itemsCount": 10025 }26}
Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | |
---|---|
Field | Description |
object | Contains information about the timestamps |
array | Contains information about notifications. |
object | Contains information about response paging. |
summary object | |
Field | Description |
string | Timestamp (ISO 8601 format) marking the start of a period the report is generated for. |
string | Timestamp (ISO 8601 format) marking the end of a period the report is generated for. |
notification array | |
Field | Description |
string | Notification title. |
string | Notification body. |
object | Object representing a contact to which this notification has been sent. |
status | Object representing the outcome of the notification being sent. |
timestamp | The time when an entry was created, which is also the time when the notification was sent. |
contact object | |
Field | Description |
string | Contact type: |
string | Actual contact string. |
status object | |
Field | Description |
string | Either |
string |
|
resultInfo object | |
Field | Description |
integer | Maximum number of items returned in the response. |
integer | Number of the items page to be returned in the response. Maximum number of elements on the page is equal to the maxResult value. |
integer | Number of returned items on the page. |
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Bad Request : Wrong datetime format. |
Example
List all sent notifications.
Request URL
https://api.tomtom.com/notifications/1/history?key={Your_API_Key}&from=2020-05-01T02:00:00&to=2020-05-01T20:00:00
Response body
The following JSON code block demonstrates a successful response from the API server.
1{2 "summary": {3 "from": "2020-05-01T02:00:00+0000",4 "to": "2020-05-01T20:00:00+0000"5 },6 "notifications": [7 {8 "title": "Message 1 title.",9 "body": "Message 1 body.",10 "contact": {11 "type": "WEBHOOK",12 "value": "URL_INVALID"13 },14 "status": {15 "type": "FAILURE",16 "details": "WEBHOOK format is invalid"17 },18 "sendDate": "2020-05-01T18:52:51+0000"19 },20 {21 "title": "Message 2 title.",22 "body": "Message 2 body.",23 "contact": {24 "type": "WEBHOOK",25 "value": "http://example.com/example"26 },27 "status": {28 "type": "SUCCESS",29 "details": "OK"30 },31 "sendDate": "2020-05-01T14:03:46+0000"32 }33 ],34 "resultInfo": {35 "maxResults": 100,36 "pageNumber": 1,37 "itemsCount": 238 }39}