Request:
https://emailidea.biz/api/SendEmail
For Example:
https://emailidea.biz/api/sendEmail?key=AbCdEfGhIjKlMnOpQrStUvWxYz123456&to=919812345678&message=Hello&IsUrgent=false
Calling HTTP API Using C#.Net
using System;
using RestSharp;
public void sendEmail()
{
var client = new RestClient("https://emailidea.biz/api/sendEmail");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("ApiKey", "9safkjstjgorewtndfauregfd3b6a735ab");
request.AddParameter("From", "relay@eimails152fg.co.in");
request.AddParameter("FromName", "Xyz");
request.AddParameter("ReplyTo", "relay@eimails152fg.co.in");
request.AddParameter("To", "xyz@gmail.co.in");
request.AddParameter("Subject", "Xyz");
request.AddParameter("Body", "XYZ");
request.AddParameter("ScheduleTime", "29-Dec-2022 11:45:52 AM");
IRestResponse response = client.Execute(request);
Console.WriteLine(response .Content);
}
Calling HTTP API Using JavaScript - jQuery
var settings = {
"url": "https://emailidea.biz/api/SendEmail",
"method": "POST",
"timeout": 0,
"headers":{
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"ApiKey": "9adshgfklesgdfhgk8f6d3b6a735ab",
"From": "relay@eimailsdgfh.co.in",
"FromName": "Xyz",
"ReplyTo": "Xyz",
"To": "Xyz@gmail.co.in",
"Subject": "Xyz",
"Body": "Xyz",
"ScheduleTime": "29-Dec-2022 11:45:52 AM"
}
};
$.ajax(settings).done(function (response) {
Console.WriteLine(response);
});
Calling HTTP API Using php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://emailidea.biz/api/sendEmail',
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 =>
'ApiKey=9aaaeawedfhe4rgrb6a735ab&
From=relay%40eimailsshf.co.in&
FromName=xyz%zz&
ReplyTo=relay%40eimailssaf.co.in&
To=xyz%40gmail.co.in&
Subject=xyz&
Body=xyz&
ScheduleTime=29-Dec-2022%2011%3A45%3A52%20AM',
CURLOPT_HTTPHEADER => array( 'Content-Type: application/x-www-form-urlencoded'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Calling HTTP API Using Java
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public void sendEmail() {
try {
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType,
"ApiKey=9aaaeadgsbr5155fdg6a735ab&
From=relay@eimailsdgjsdf.co.in&
FromName=Xyz&
ReplyTo=relay@eimailssfdw4.co.in&
To=Xyz@Gmail.co.in&
Subject=Xyz &
Body=Xyz&
ScheduleTime=29-Dec-2022 11:45:52 AM"
);
Request request = new Request.Builder()
.url(("https://emailidea.biz/api/sendEmail"))
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
Calling HTTP API Using Python
import http.client
conn = http.client.HTTPSConnection("https://emailidea.biz")
payload =
'ApiKey=9aaaedejthr4treb6a735ab&
From=relay%40eimailsdfgg.co.in&
FromName=Xyz%&
ReplyTo=relay%40eimailssydfe.co.in&
To=Xyz%40gmail.co.in&
Subject=Xyz&
Body=Xyz&
ScheduleTime=29-Dec-2022%2011%3A45%3A52%20AM'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
conn.request("POST", "/api/SendEmail", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))