Links

Send Email

post
https://api.saino.io
/api/apis/email/send
Send Email

Callback Url response

below is the notification response received in provided callback url related to each email id.
{
emailId: "[email protected]", //provided to email id
status: "sent/opened/clicked/bounce/complaint/unsubscribed", //this is email status
campaignId: "8asd6sx-as6tasvdt-asdg532v" //campaign id to identify
}

Examples

NodeJs
PHP
Python
C
C#
HTTP
JAVA
SWIFT
var axios = require('axios');
var data = JSON.stringify(
{
"subject":"API test 1",
"fromName":"sahil",
"bodyHtml":"<h1>Test 1</h1>",
"trackClicks":true,
"trackOpens":true,
"replyToEmail":"[email protected]",
"attachments":[],
"replyToName":"sam",
"bodyText":"Just Text Email",
"callbackUrl":"https://domain.com/webhook"
}
);
var config = {
method: 'post',
url: 'https://api.saino.io/api/apis/email/send',
headers: {
'Authorization': 'Bearer 808ciij4p18351yml==/pitzkg67bizz0qce1599144457846',
'Content-Type': 'application/json'
},
data : data
};
axios(config).then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.saino.io/api/apis/email/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer 808ciij4p1835zba8ykvkw9p==/pitzkg67bizz0qce1599144457846",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.saino.io/api/apis/email/send"
payload = "{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}"
headers = {
'Authorization': 'Bearer 808ciij4p1835h8gkybgzba8ykvkw9pz0qce1599144457846',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.saino.io/api/apis/email/send");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer 808ciij4p18351v9rh8gkybgzba8ykvkw9p==/pitzkg67bizz0q99144457846");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
var client = new RestClient("https://api.saino.io/api/apis/email/send");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer 808ciijv9rzg5h8gkybgzba8ykvkw9p==/dsaddadasdda");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
POST /api/apis/email/send HTTP/1.1
Host: api.saino.io
Authorization: Bearer 808ciij4p18351ymliiznhybgzba8ykvkw9p==/qce1599144457846
Content-Type: application/json
{
"to":["[email protected]"],
"subject":"API test 1",
"from":"[email protected]",
"fromName":"sainofirst",
"bodyHtml":"<h1>Test 1</h1>",
"trackClicks":true,
"trackOpens":true,
"replyToEmail":"[email protected]",
"attachments":[],
"replyToName":"sainofirst2",
"bodyText":"Just Text Email",
"callbackUrl":"https://domain.com/webhook"
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}");
Request request = new Request.Builder()
.url("https://api.saino.io/api/apis/email/send")
.method("POST", body)
.addHeader("Authorization", "Bearer 808ciij4p183hrkv9rzg5h8gkybgzba8yasdp==/sadsd")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"to\":[\"[email protected]\"], \n \"subject\":\"API test 1\", \n \"from\":\"[email protected]\", \n \"fromName\":\"sainofirst\", \n \"bodyHtml\":\"<h1>Test 1</h1>\", \n \"trackClicks\":true, \n \"trackOpens\":true, \n \"replyToEmail\":\"[email protected]\", \n \"attachments\":[], \n \"replyToName\":\"sainofirst2\", \n \"bodyText\":\"Just Text Email\",\n \"callbackUrl\":\"https://domain.com/webhook\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.saino.io/api/apis/email/send")!,timeoutInterval: Double.infinity)
request.addValue("Bearer 808ciij4pzba8ykvkw9p==/pitzkg99144457846", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()