Connecting to the Enveloop API
Send messages on Enveloop by connecting directly via HTTPS
Connecting
You can connect directly over HTTPS or by using one of the provided SDKs
Connecting via HTTPS
Endpoint
You can send messages directly over HTTPS by sending a request to any of the Api Endpoints:
(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": "[email protected]",
"from": "Northwind App <[email protected]>",
"subject": "Welcome to Northwind",
"templateVariables": {
"name": "Bob Vance"
}
}' \
"https://api.enveloop.com/messages"
JS fetch example
data = {
to: "[email protected]",
from: "Northwind App <[email protected]>",
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))
Last updated