Get the previous or next message ID
GET /api/2.0/mail/messages/{id:[0-9]+}/{direction:(next|prev)}
Request
Returns the previous or next message ID filtered with the parameters specified in the request.
Authorization
An API key is a token that you provide when making API calls. Include the token in a header parameter called Authorization
.
Example: Authorization: 864FE52C-1C1C-469F-9308-51DAFEFE7436
.
Headers
- Accept
enum of string
Can be one of:
application/json
.- Content-Type
enum of string
Can be one of:
application/json
.
Body
- id
integer
Head message ID of the current conversation
- direction
string
Defines if the previous or next message is needed: "prev" for previous, "next" for next
- folder
array of integer
Folder type: 1 - inbox, 2 - sent, 5 - spam
- unread
array of boolean
Message status: unread (true), read (false), or all (null) messages
- attachments
array of boolean
Defines if a message has attachments or not: with attachments (true), without attachments (false), or all (null) messages
- period_from
array of integer
Start search period date
- period_to
array of integer
End search period date
- important
array of boolean
Specifies if only important messages will be displayed or not
- from_address
string
Mail address from which a letter was received
- to_address
string
Mail address to which a letter was sent
- mailbox_id
array of integer
Recipient mailbox ID
- tags
array of integer
IDs of tags linked to the target message
- search
string
Text to search in the message bodies and subjects
- page_size
array of integer
Number of messages on the page
- sortorder
string
Sort order by date: "ascending" or "descending"
- with_calendar
array of boolean
Specifies if the messages have a calendar or not
- user_folder_id
array of integer
User folder ID
Examples
GET /api/2.0/mail/messages/%7Bid:[0-9]+%7D/%7Bdirection:(next%7Cprev)%7D HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: example.com
curl --request GET \
--url 'https://example.com/api/2.0/mail/messages/%7Bid:[0-9]+%7D/%7Bdirection:(next%7Cprev)%7D' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
Responses
200
Previous or next message ID
401
Unauthorized