This API sends out an existing email in your Juvlon account to an email address or a subscriber ID.
There should be atleast one recipient provided in any one of the following parameters: subID / email. However, if you provide both, then subID takes preference.
You can provide all the personalization details of the recipient that you need in your email, like the first name, last name, etc.. The API will first update any existing subscriber that it finds with the matching subID / email address with these personalization details, and then send the specified email. If there is no existing subscriber with the email address provided, then the API will first create a new subscriber with all the personalization data, and then send out the email to the new subscriber.
This API needs to be called using an HTTP Post method with data in JSON format as shown below.
URL: https://api2.juvlon.com/v4/sendMailer
JSON Parameters
'{"apiKey":"$apiKey", "mailerID":"$mailerID", "from":"$from", "fromName":"$fromName", "subID":"$subID", "email":"$email", "mobile":"$mobile", "listName":"$listName", "prefix":"$prefix", "firstName":"$firstName", "middleName":"$middleName", "lastName":"$lastName", "phone":"$phone", "address":"$address", "city":"$city", "state":"$state", "pinCode":"$pinCode", "country":"$country", "residencePhone":"$residencePhone", "designation":"$designation", "company":"$company", "companyAddress":"$company", "companyCity":"$company", "companyState":"$company", "companyCountry":"$company", "companyPin":"$company", "companyPhone":"$companyPhone", "companyFax":"$companyFax", "birthday":"$birthday", "anniversary":"$anniversary", "referenceNo":"$referenceNo", "extra1":"$extra1", "extra2":"$extra2", "extra3":"$extra3", "extra4":"$extra4", "extra5":"$extra5", "extra6":"$extra6", "trackOpens":"$trackOpens", "trackClicks":"$trackClicks", "customField":"$customField" }';
Arguments
Name | Type | Description | Default |
---|---|---|---|
apiKey | String | Mandatory. The ApiKey that gives you access to our HTTP APIs.The ApiKey authenticates you and helps us to identify your Juvlon account. It is common for all the requests in an API call and must be provided outside the request(s). | |
mailerid | Int | Mandatory. The message ID of the already created email in your Juvlon account that you would like to send. | |
from | String | This optional parameter is email address to be used as the sender of the email. The email address should be an active registered sender in your Juvlon account. If this parameter is not specified, the assigned address to the mailer (during creation) is used as the “from”. This field is mandatory if fromName is passed as a parameter. | |
fromName | String | This optional parameter is name to be used for the sender of the email. If this parameter is not specified, the assigned sender to the mailer (during creation) is used as the “fromName”. Note : If fromName passed then the “from” parameter is mandatory. | |
subid | Int | The subscriber ID of an already existing subscriber in your Juvlon account that you would like to send the email to. | |
String | The email address to send the email to.This field is ignored if there is a “subID” present in the API call. | ||
mobile | String | The mobile number of your recipient. To be used as a personalization in your email. | |
listName | String | The name of an existing list into which you would like to add the recipient as a subscriber. | RealTime_Via_API |
prefix | String | The prefix / title of your email recipient. E.g. Mr., Mrs., Dr. etc.. To be used as a personalization in your email. | |
firstName | String | The first name of your email recipient. To be used as a personalization in your email. | |
middleName | String | The middle name of your email recipient. To be used as a personalization in your email | |
lastName | String | The last name of your email recipient. To be used as a personalization in your email | |
phone | String | The primary telephone of your email recipient. To be used as a personalization in your email | |
address | String | The residential address of your email recipient. To be used as a personalization in your email | |
city | String | The city in which your email recipient resides. To be used as a personalization in your email | |
state | String | The state in which your email recipient resides. To be used as a personalization in your email | |
pinCode | String | The pin code of your email recipient’s residential address. To be used as a personalization in your email | |
country | String | The Country where your email recipient resides. To be used as a personalization in your email | |
residencePhone | String | The residence phone number of your email recipient. To be used as a personalization in your email | |
designation | String | The official designation of your email recipient. To be used as a personalization in your email | |
company | String | The company in which your email recipient works. To be used as a personalization in your email | |
companyAddress | String | The company address where your email recipient works. To be used as a personalization in your email | |
companyCity | String | The city where your email recipient works. To be used as a personalization in your email | |
companyState | String | The state where your email recipient works. To be used as a personalization in your email | |
companyCountry | String | The Country where your email recipient works. To be used as a personalization in your email | |
companyPin | String | The pin code of the area where your email recipient works. To be used as a personalization in your email | |
companyPhone | String | The office phone number of your email recipient. To be used as a personalization in your email | |
companyFax | String | The office fax number of your email recipient. To be used as a personalization in your email | |
birthday | String | Your email recipient’s birthday in ‘yyyy-mm-dd’ format. Can be used to trigger emails on the recipient’s birthday or as a personalization in emails / SMS. | |
anniversary | String | Your email recipient’s anniversary date in ‘yyyy-mm-dd’ format. Can be used to trigger emails on the recipient’s anniversary day or as a personalization in emails / SMS. | |
referenceNo | String | Any reference number that you want to use for the email recipient. To be used as a personalization in your email | |
extra1 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
extra2 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
extra3 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
extra4 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
extra5 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
extra6 | String | Any extra information that you may like to store about your email recipient. To be used as a personalization in your email | |
trackOpens | Int | Set flag 1 to enable opens tracking, 0 (default) for no tracking. | |
trackClicks | Int | Set flag 1 to enable clicks tracking, 0 (default) for no tracking. | |
customField | String | Customized text for your internal tracking. |
Return value
Type | Type | Description | |
---|---|---|---|
code | String | The Success or Error response code as returned by the API. Please refer to the section “Possible-Response-Codes” for more details. | |
status | String | Description of the error code returned. | |
transactionId | String | A number generated by the API to uniquely identify the current call. Also known as the API_Call_ID. |
Usage / Example(s)
# Try this API. Copy & run this in your terminal. curl -i -X POST -H "Content-Type: application/json" -d \ '{ "apiKey":"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY", "email":"sales@nichelive.com", "mailerID":"2" }' https://api2.juvlon.com/v4/sendMailer
# Copy & run this in your Ruby terminal. require 'net/http' require 'json' require 'uri' uri = URI('https://api2.juvlon.com/v4/sendMailer') Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| request = 'application/json') request.body = {"apiKey":"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY", "mailerID":"2", "email":"sales@nichelive.com"}.to_json response = http.request request # Net::HTTPResponse object puts "response #{response.body}" end
# Copy & run this in your Python terminal. import json import requests url = "https://api2.juvlon.com/v4/sendMailer" data = {"apiKey":"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY", "mailerID":"2", "email":"sales@nichelive.com"<} data_json = json.dumps(data) r = requests.post(url, data=data_json) print(r)
# Try running locally. $url = 'https://api2.juvlon.com/v4/sendMailer'; $data = '{"apiKey":"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY", "mailerID":"2", "email":"sales@nichelive.com" }'; $options = array( 'http' => array( 'header' => "Content-type: application/json\r\n", 'method' => 'POST', 'content' => $data ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { /* Handle error */ } print_r($result); ?>
// Include below 4 references in your program; import java.io.IOException; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; // Include below code in your program final String POST_PARAMS = "{\"apiKey\":\"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY\"" + ",\"mailerID\":\"2\"" + ",\"email\":\"sales@nichelive.com\""+ "}"; System.out.println(POST_PARAMS); URL obj = new URL("https://api2.juvlon.com/v4/sendMailer"); HttpURLConnection postConnection = (HttpURLConnection) obj.openConnection(); postConnection.setRequestMethod("POST"); postConnection.setRequestProperty("Content-Type", "application/json"); postConnection.setDoOutput(true); OutputStream os = postConnection.getOutputStream(); os.write(POST_PARAMS.getBytes()); os.flush(); os.close(); int responseCode = postConnection.getResponseCode(); System.out.println(responseCode);
// Include below 3 references using System.Net; using System.Text; using System.IO; // Add below code in your application string url="https://api2.juvlon.com/v4/sendMailer"; HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); myHttpWebRequest.Method = "POST"; string postData = "{\"apiKey\":\"INSERT_YOUR_JUVLON_ACCOUNT_API_KEY\"" + ",\"email\":\"sales@nichelive.com\"" + ",\"mailerID\":\"2\"}"; byte[] data = Encoding.ASCII.GetBytes(postData); myHttpWebRequest.ContentType = "application/json"; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; myHttpWebRequest.ContentLength = data.Length; Stream requestStream = myHttpWebRequest.GetRequestStream(); requestStream.Write(data, 0, data.Length); requestStream.Close(); HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); Stream responseStream = myHttpWebResponse.GetResponseStream(); StreamReader myStreamReader = new StreamReader(responseStream, Encoding.Default); string pageContent = myStreamReader.ReadToEnd(); Console.WriteLine(pageContent); myStreamReader.Close(); responseStream.Close(); myHttpWebResponse.Close();
Success-Response
HTTP/1.1 { "code":200, "status":"Success", "transactionId":327 }
Error-Response
HTTP/1.1 { "code":442, "status":"Error" }
Possible-Response-Codes
200 Success: API Request Accepted 401 Error:Invalid Method 402 Error: Unauthorized/Empty Key 403 Error: Unauthorized/Invalid Key 404 Error: Account Sending Blocked 405 Error: Your Juvlon account is expired 448 Your Juvlon account is Deactivated 602 Error: No subscriber provided 454 Error: Subscriber does not exist 412 Error: Invalid recipient email address 414 Error: Sender Domain Blacklisted 416 Error: Recipient Email Domain blacklisted 417 Bounced 418 Delivered 443 Error:INACTIVE Subscriber 444 Low Subscriber credit 445 Low Email credit 451 Opened 452 Clicked 478 Error: from or fromName not provided.