Retrieving Items
You can retrieve items using the following query parameters:
- first: Specifies the number of items to retrieve (e.g.,
first=50
). - after: Cursor for pagination to retrieve items after a specific point.
- last: Specifies the number of items to retrieve from the end (e.g.,
last=50
). - before: Cursor for pagination to retrieve items before a specific point.
Example Request
To retrieve the first 50 items, use the following endpoint:
GET https://api.usestable.com/v1/mail-items?first=50
Response Structure
The response will include pagination information:
"pageInfo": {
"endCursor": "YOUR_END_CURSOR",
"hasNextPage": true,
"hasPreviousPage": true,
"startCursor": "YOUR_START_CURSOR"
}
Pagination Examples
-
Retrieve the Next 50 Items
To get the next 50 items, append theafter
parameter with theendCursor
from the previous response:GET https://api.usestable.com/v1/mail-items?first=50&after=YOUR_END_CURSOR
-
Retrieve the Last 50 Items
To retrieve the last 50 items, use thelast
parameter:GET https://api.usestable.com/v1/mail-items?last=50
-
Retrieve Items Before a Specific Cursor
To get items before a specific point, use thebefore
parameter with the desired cursor:GET https://api.usestable.com/v1/mail-items?last=50&before=YOUR_START_CURSOR
This structure facilitates efficient navigation through the list of items, allowing for both forward and backward pagination.