API Example

Send a transactional message

POST https://txnhog.co/txn/api/your_message_key

API POST Example for sending a transactional message. This is a simple example of sending a name, email, and phone number to the transactional template. The API accepts only string values, as application/json or application/x-www-form-urlencoded. When using an email template, the parameter "email" is required, and when using an sms template, the parameter "phone" is required.

Request Body

Name
Type
Description

apiKey

string

Your API key, listed below each of your transactional messages. This key is private, and should only be used server-side.

name

string

Name of the person receiving the transactional message. Exposed in your template with the {{name}} tag

email

string

Exposed in your template with the {{email}} tag. Required if sending an email.

phone

string

Exposed in your template with the {{phone}} tag. Required if sending an sms.

{    "name": "Cake's name",    "recipe": "Cake's recipe name",    "cake": "Binary cake"}

You can POST any key/value pair of up to 1400 characters each. This allows for variables to insert password reset links, image urls, just about anything. Note that HTML will be sanitized and encoded.

Last updated