Welcome to Inboxroad WEBApi’s documentation!
Overview
Inboxroad is a company that allows you to send millions of emails per day for fair price.
We provide emails servers for sending campaigns, personal letters and many other thing.
We encourage our costumers to create campaigns using our services.
WEB Api is a service that can help you to develop/integrate you solution for ability to send emails.
WEB Api is a similar to the Amazon SES and Sendgrid.
But instead of playing around with bad APIs and figuring out How it works you can try it.
Our API gives you all the functionality for sending letter but with a single HTTP request as well
as an ability to fully customize it.
Obtain a token
For obtaining an API token for profiles, send a POST
request to the endpoint:
https://webapi.inboxroad.com/api/token/
There is also interactive version where you can try out sending requests: link
The payload for the request should be a JSON
of the following type:
{
"username": "string",
"password": "string"
}
All fields are required!
Examples:
curl --location --request POST 'https://webapi.inboxroad.com/api/token/' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "test@test.test",
"passowrd": "etesttes"
}'
import requests
import json
url = "https://webapi.inboxroad.com/api/token/"
payload = {"username": "test@test.test", "password": "etestetst"}
response = requests.post(url, json=payload)
print(response.text)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://webapi.inboxroad.com/api/token/');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"username": "test@test.test",
"passowrd": "etesttes"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();>
require "uri"
require "net/http"
url = URI("https://webapi.inboxroad.com/api/token/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = "{\n \"username\": \"test@test.test\",\n \"passowrd\": \"etesttes\"\n}"
response = https.request(request)
puts response.read_body
Sending message
Before sending a message retrieve a token. :ref: How to obtain token
Token should be provided in headers as an Authorization
header with following format:
Basic <your_token_here>
To send a message provide a POST
request with a JSON
payload for the endpoint:
https://webapi.inboxroad.com/api/v1/messages/
The payload should be the following format:
{
"from_email": "user@example.com",
"from_name": "string",
"to_email": "user@example.com",
"to_name": "string",
"reply_to_email": "user@example.com",
"reply_to_name": "string",
"subject": "string",
"text": "string",
"headers": {},
"html": "string",
"attachments": [
{
"filename": "string",
"mime_type": "string",
"file_data": "base64_string"
}
]}
Required fields
Field name |
Description |
from_email |
string - a valid email like string that represent from whom this email was sent of
|
to_email |
string - a valid email like string that is presenting a person who would receive an email
|
text |
string - a text field that contains a body of the message. If html is empty this field is required
|
html |
string - a html formatted string field that contains html template for the email. If text is empty this field is required
|
For more details and interactive behaviour please visit this link
Examples:
curl --location --request POST 'https://webapi.inboxroad.com/api/v1/messages' \
--header 'Authorization: Basic <example_token_here>' \
--header 'Content-Type: application/json' \
--data-raw '{
"from_email": "example@example.com",
"from_name": "Example",
"to_email": "example@example.com",
"to_name": "Example",
"reply_to_email": "example@example.com",
"reply_to_name": "Example",
"subject": "Example",
"text": "Example",
"html": "<h1>example@example.com</h1>"
}'
import requests
url = "https://webapi.inboxroad.com/api/v1/messages"
payload={
"from_email": "example@example.com",
"from_name": "Example",
"to_email": "example@example.com",
"to_name": "Example",
"reply_to_email": "example@example.com",
"reply_to_name": "Example",
"subject": "Example",
"text": "Example",
"html": "<h1>example@example.com</h1>"
}
headers = {
'Authorization': 'Basic <example_token_here>',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://webapi.inboxroad.com/api/v1/messages');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"from_email": "example@example.com",
"from_name": "Example",
"to_email": "example@example.com",
"to_name": "Example",
"reply_to_email": "example@example.com",
"reply_to_name": "Example",
"subject": "Example",
"text": "Example",
"html": "<h1>example@example.com</h1>"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'Basic <example_token_here>',
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();>
require "uri"
require "net/http"
url = URI("https://webapi.inboxroad.com/api/v1/messages")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic <example_token_here>"
request["Content-Type"] = "application/json"
request.body = "{\n \"from_email\": \"example@example.com\",\n \"from_name\": \"Example\",\n \"to_email\": \"example@example.com\",\n \"to_name\": \"Example\",\n \"reply_to_email\": \"example@example.com\",\n \"reply_to_name\": \"Example\",\n \"subject\": \"Example\",\n \"text\": \"Example\",\n \"html\": \"<h1>example@example.com</h1>\"\n}"
response = http.request(request)
puts response.read_body