import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const messageListResponse of client.threads.messages.list(
'thr_01kabn43yqyxn2bx4ve84mczd3',
)) {
console.log(messageListResponse.id);
}{
"data": [
{
"id": "<string>",
"createdAt": "<string>",
"domainId": "<string>",
"domainName": "<string>",
"inboxId": "<string>",
"threadId": "<string>",
"fromAddress": "<string>",
"fromName": "<string>",
"toAddresses": [
{
"address": "jsmith@example.com",
"name": "<string>"
}
],
"ccAddresses": [
{
"address": "jsmith@example.com",
"name": "<string>"
}
],
"subject": "<string>",
"receivedAt": "<string>",
"direction": "received",
"status": "received",
"spfVerdict": "<string>",
"dkimVerdict": "<string>",
"spamVerdict": "<string>",
"virusVerdict": "<string>",
"attachmentCount": 123
}
],
"nextCursor": "<string>"
}List messages in a thread (chronological order).
import Nuntly from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const messageListResponse of client.threads.messages.list(
'thr_01kabn43yqyxn2bx4ve84mczd3',
)) {
console.log(messageListResponse.id);
}{
"data": [
{
"id": "<string>",
"createdAt": "<string>",
"domainId": "<string>",
"domainName": "<string>",
"inboxId": "<string>",
"threadId": "<string>",
"fromAddress": "<string>",
"fromName": "<string>",
"toAddresses": [
{
"address": "jsmith@example.com",
"name": "<string>"
}
],
"ccAddresses": [
{
"address": "jsmith@example.com",
"name": "<string>"
}
],
"subject": "<string>",
"receivedAt": "<string>",
"direction": "received",
"status": "received",
"spfVerdict": "<string>",
"dkimVerdict": "<string>",
"spamVerdict": "<string>",
"virusVerdict": "<string>",
"attachmentCount": 123
}
],
"nextCursor": "<string>"
}Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>
The id of the thread
"thr_01kabn43yqyxn2bx4ve84mczd3"
The cursor to retrieve the next page of results
The maximum number of results to return
1 <= x <= 30