Fetching Messages
Fetching inbox messages
The GET /v3/safemail/inbox
endpoint is used to fetch SafeMail inbox messages.
GET /v3/safemail/inbox?pageNumber=1&pageSize=10&sortBy=id&sortDirection=descending&fromDate=2020-01-01&toDate=2024-01-01
Authorization: Basic ${ base64(apiKey + ':' + secretKey) }
Parameter | Required | Description |
---|---|---|
pageNumber | No | Which page to fetch. Defaults to 1. |
pageSize | No | The size of the page. Can be no more than 100. Defaults to 10. |
sortBy | No | Which property to sort the results by. Can be one of: 'id', 'dateTime', 'autoDeleteDate'. Defaults to 'id'. |
sortDirection | No | Can be one of: 'ascending', 'descending'. Defaults to 'ascending'. |
fromDate | No | A date in 'yyyy-MM-dd' format of which all returned SafeMail inbox messages will have been received after. |
toDate | No | A date in 'yyyy-MM-dd' format of which all returned SafeMail inbox messages will have been received before. |
Response example:
HTTP/2.0 200 OK
{
"data": [
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"receivedAt": "2022-01-26 13:05:40",
"autoDeleteDate": "2022-07-25",
"responded": false,
"status": "DONE",
"attachments": ["file.pdf"],
"sender": {
"ssn": "YYYYMMDDXXXX",
"country": "SWEDEN",
"name": "FirstName LastName"
},
"form": {
"name": ""
},
"content": {
"Telephone": "phone",
"message": "message",
"Fil": "file",
"Check": "true"
}
}
],
"totalPages": 1,
"totalElements": 1,
"numberOfElements": 1
}
Fetching outbox messages
The GET /v3/safemail/outbox
endpoint is used to fetch SafeMail outbox messages.
GET /v3/safemail/outbox?pageNumber=1&pageSize=10&sortBy=id&sortDirection=descending&fromDate=2020-01-01&toDate=2024-01-01
Authorization: Basic ${ base64(apiKey + ':' + secretKey) }
Parameter | Required | Description |
---|---|---|
pageNumber | No | Which page to fetch. Defaults to 1. |
pageSize | No | The size of the page. Can be no more than 100. Defaults to 10. |
sortBy | No | Which property to sort the results by. Can be one of: 'id', 'dateTime', 'autoDeleteDate'. Defaults to 'id'. |
sortDirection | No | Can be one of: 'ascending', 'descending'. Defaults to 'ascending'. |
fromDate | No | A date in 'yyyy-MM-dd' format of which all returned SafeMail outbox messages will have been sent after. |
toDate | No | A date in 'yyyy-MM-dd' format of which all returned SafeMail outbox messages will have been sent before. |
Response example:
HTTP/2.0 200 OK
{
"data": [
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"sentAt": "2022-01-26 13:05:40",
"autoDeleteDate": "2022-07-25",
"subject": "",
"body": "",
"attachments": ["file.pdf"],
"recipients": [
{
"ssn": "YYYYMMDDXXXX",
"country": "SWEDEN",
"email": "firstname.lastname@example.com",
"name": "FirstName LastName",
"read": false,
"signed": false
}
]
}
],
"totalPages": 1,
"totalElements": 1,
"numberOfElements": 1
}