HTTP POST
POST /api/2013-12-01/Email/[Agency ID]
You must POST at least the following to send an e-mail.
Parameter | Description |
---|---|
Body | The e-mail body. Formatted as HTML. |
From_Name | The name that should appear in the e-mails From header. Minimum of 6 characters, maximum of 255 characters. |
From_Email | The e-mail address that should appear in the e-mails reply-to header. This is the e-mail address that will receive any replies sent from recipients. |
Subject | The e-mail’s subject. Minimum of 16 characters, maximum of 255 characters. |
User_ID | The ReadyOp User ID of the account that should be used to send the e-mails. For audit and history purposes the e-mail will be logged as having been sent from this account inside ReadyOp. |
Additionally you must POST at a minimum either an array of Contacts and/or an array of Topics and/or an array of Objects.
Parameter | Description |
---|---|
Contacts | An array / list of all of the contacts you’d like to send an email to as well as their destination e-mail index. |
Objects | An array / list of all of the object ids you’d like to send an email. |
Topics | An array / list of all the topic names for which you’d like to send a notification. |
If you’re providing a list of contacts, each contact in the Contacts list should include the following fields:
Parameter | Description |
---|---|
Contact_ID | The contact’s unique Contact ID. |
The contact’s e-mail identifier/index. This can be obtained when pulling a contact’s information using the Get a Contact API request. |
Optionally you may POST an array of Attachments
Parameter | Description |
---|---|
Attachments | An array / list of all of the attachments you’d like to include. The total file size of all attachments cannot exceed 6MiB. |
If you’re providing a list of attachments, each attachment in the Attachments list should include the following fields:
Parameter | Description |
---|---|
Name | The filename of the attachment, including the file extension. |
Data | A Base64 encoded representation of the raw file data. |
Example Request
$ curl -XPOST https://[Site Name].readyop.com/api/2013-12-01/Email/[Agency ID] \
-d "From_Name=John%Doe" \
-d "From_Email=john.doe@email.com" \
-d "Subject=This%20is%20a%20test%20email%20from%20the%api" \
-d "Body=This%20is%20just%20a%20test" \
-d "Contacts[0][Contact_ID]=1234" \
-d "Contacts[0][Email]=0" \
-d "Topics[0]=test-topic \
-d "Objects[0]=4321 \
-d "Attachments[0][Name]="My-File.jpg" \
-d "Attachments[0][Data]="R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEA" \
-u "[API Account ID]:[API Token]"
Request Result
{
"code": 0,
"status": 200,
"detail": "Success",
"timestamp": "2017-02-27T19:32:45+00:00",
"email": {
"Email ID": 820
}
}