Enveloop Docs
Sign up for Enveloop!
  • Enveloop Docs
  • Overview
    • ✨Features
  • Getting Started
    • Introduction to Enveloop
    • Creating a Template
    • Formatting / Dynamic Content
    • Sending a test message
    • Adding a Sending Domain
    • Deploying your first message
  • Product Guides
    • Elements
      • 🔋Table
    • Using Shared Sections
    • Markdown for Formatting
    • Mustache for Dynamic Content
    • Creating a Verified Sender
    • Logging
    • Monitoring
    • Webhooks
    • Themes
  • Integrations
    • Do I need integrations?
    • SMS Integrations
      • Twilio
      • TextGrid
    • Email Integrations
      • SendGrid
      • Postmark
      • Mailgun
      • Amazon SES
      • SMTP
        • ✉️Amazon SES
        • ✉️Gmail SMTP
        • ✉️Google Domain SMTP Relay
    • Partner Integrations
      • Fly.io
  • Enveloop API
    • Getting Started with Enveloop API
    • Core API Endpoints
      • Connecting to the Enveloop API
      • POST /messages
      • GET /templates/:slug
    • Languages and Frameworks
      • 🟢NodeJS
      • 🏮Ruby on Rails
      • 🟡Python
      • 🏮Ruby
  • Settings
    • Sending IPs
  • Company
    • About Us
    • 👩‍⚖️Terms of Service
    • 😎Privacy Policy
Powered by GitBook
On this page
  • Connecting
  • Connecting via HTTPS
  • Endpoint
  • Authentication
  • cURL example
  • JS fetch example
  1. Enveloop API
  2. Core API Endpoints

Connecting to the Enveloop API

Send messages on Enveloop by connecting directly via HTTPS

Last updated 1 year ago

Connecting

You can connect directly over HTTPS or by using one of the provided

Connecting via HTTPS

Endpoint

You can send messages directly over HTTPS by sending a request to any of the : (ex: POSThttps://api.enveloop.com/messages)

Authentication

You will need to pass your Api Token as an Authorization header prefixed with token. Authorization: token <API Token>

cURL example

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token test_eYLQRrzxLcLAlmb2H5BXIFSUor3h/tRr" \
-d '{
      "template": "user-welcome",
      "to": "bob@test.com",
      "from": "Northwind App <app@northwind.com>",
      "subject": "Welcome to Northwind",
      "templateVariables": {
        "name": "Bob Vance"
      }
    }' \
"https://api.enveloop.com/messages"

The above cURL example uses a Sandbox token. Sandbox tokens, used with cURL commands in Enveloop, are an easy way to test your message structure and style. You can view Sandbox messages in the Message Log area of the project.

JS fetch example

data = {
  to: "bob@test.com",
  from: "Northwind App <app@northwind.com>",
  subject: "Welcome to Northwind",
  template: "user-welcome",
  templateVariables: {
    name: "Bob Vance"
  }
}

fetch("https://api.enveloop.com/messages", {
  method: "POST",
  body: JSON.stringify(data),
  headers: {
    "Content-Type": "application/json",
    "Authorization": "token test_eYLQRrzxLcLAlmb2H5BXIFSUor3h/tRr",
  },
})
.then(response => response.json()) 
.then(json => console.log(json))
.catch(err => console.log(err))
SDKs
Api Endpoints