SendLayer sends emails through the API based on JSON input. The JSON properties, such as Subject, HTMLContent, and PlainContent, are converted to a valid message when sent to the recipient.
Note: A table containing custom error codes can be found in Schemas » Error codes.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Below is the JSON payload required for sending a single email. Be sure to replace the example email addresses with valid email addresses in the From and To objects.
Note: The From email address must contain your sender domain, which is the domain that you’ve verified in SendLayer. For example, if you’ve authorized example.com you’ll need to use [email protected].
Additionally, you can send emails to multiple recipients by adding more objects to the To, CC,and BCC arrays within the specified limits. See our Getting Started guide for more details.
"This is the email subject"
"HTML"
"<html><body><p>This is a test email sent with the <a href=\\\"https://sendlayer.com\\\">SendLayer</a> API!</p></body></html>"
OK
A successfully delivered email returns the MessageID
A successfully delivered email returns the MessageID
"8912e59e-ec88-bcd6-45dd-0012fe223ab6"