-
Notifications
You must be signed in to change notification settings - Fork 33
Messages
Igor Balos edited this page Oct 29, 2018
·
1 revision
For these API requests you will need to use a server API token. Once you obtain it, you will need to use server API client.
let postmark = require("postmark")
const serverToken = "xxxx-xxxxx-xxxx-xxxxx-xxxxxx"
let client = new postmark.ServerClient(serverToken);
client.getOutboundMessages({count:10, offset:0}).then(result => {
console.log(result.TotalCount);
console.log(result.Messages);
console.log(result.Messages[0].To);
console.log(result.Messages[0].Metadata.test);
console.log(result.Messages[0].MessageID);
});
client.getOutboundMessageDetails("xxxx-427b-47fa-ba43-xxxxxxxxx").then(result => {
console.log(result.Body);
console.log(result.Metadata.test);
console.log(result.MessageEvents.length);
});
client.getOutboundMessageDump("64812d80-427b-47fa-ba43-f27c6537025b").then(result => {
console.log(result.Body);
});
client.getInboundMessages({count: 1, offset:0}).then(result => {
console.log(result);
console.log(result.InboundMessages[0].FromFull.Email);
});
client.getInboundMessageDetails("xxxx-291a-4d9d-ac1f-xxxxx").then(result => {
console.log(result.HtmlBody);
console.log(result);
});
client.retryInboundHookForMessage("xxxx-291a-4d9d-ac1f-xxxx").then(result => {
console.log(result.Message);
});
client.bypassBlockedInboundMessage("xxxx-291a-4d9d-ac1f-xxxx").then(result => {
console.log(result.Message);
});
For additional information about the capabilities of the Postmark API, see Postmark Developers Documentation.
- Overview
- Migration from older version
- Getting started
- Email sending
- Bounces
- Templates
- Templates Push
- Server
- Servers
- Message Streams
- Webhooks
- Messages
- Domains
- Sender Signatures
- Stats
- Trigger Inbound Rules
- Suppressions
- Data Removal
- Embedding images in emails
- Error Handling
- Handling Web Hooks
- Mocking requests
- Troubleshooting
- Known issues and how to resolve them