Falconide API Guide Version 2.3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

API Guide

Version 2.3
Falconide API Guide Version 2.1

Contents
Overview ................................................................................................................................................................................................................................................................ 3
1.1 Falconide API ............................................................................................................................................................................................................................................... 3
2. Get started with Falconide API .......................................................................................................................................................................................................................... 3
2. 1. API Structure.............................................................................................................................................................................................................................................. 3
2.2 Syntax for an API call ................................................................................................................................................................................................................................... 4
3. Falconide API Library .......................................................................................................................................................................................................................................... 4
4. Sending Emails ................................................................................................................................................................................................................................................... 5
5. Template .......................................................................................................................................................................................................................................................... 11
6. Domain ............................................................................................................................................................................................................................................................. 16
7. Job .................................................................................................................................................................................................................................................................... 21
8. Report .............................................................................................................................................................................................................................................................. 27
9. Error Codes....................................................................................................................................................................................................................................................... 33
10. Support........................................................................................................................................................................................................................................................... 34

2
Falconide API Guide Version 2.1

Overview

Falconide is an SMTP relay service that delivers highly personalised transactional emails to the inbox within seconds of your customer’s transaction. Falconide helps you
focus on your business without the cost and complexity of owning and maintaining an email infrastructure. It manages all the technicalities like scaling the infrastructure,
ISP outreach, reputation monitoring, whitelist services and real-time analytics. Falconide offers world class deliverability expertise to ensure that your emails get delivered
on time and into the inbox.

1.1 Falconide API


Falconide APIs enable you to connect Falconide to a CMS, blog platform, e-commerce shopping cart and more for instant sending of transactional mails.

2. Get started with Falconide API


Falconide APIs use REST architecture in which you initiate Key authenticated JSON calls over HTTP.

The procedure to use an API is:

1. Enable API access in Falconide’s panel.


2. Submit a request via HTTP POST to Falconide. For best results, use HTTP POST.
3. Submit a call for each function. You can combine multiple calls in one HTTP request. (The maximum number of requests depends on the HTTP payload, the limit being 5
MB).

Falconide APIs support JSON for all modules, and REST format (for some modules).

2. 1. API Structure
Each API Call consist of three parts:

1. API URL
2. API Key : You can obtain the unique API key from your Falconide panel, at Settings -> API.
3. Input Data: comprise raw parameters like email, templateid, fromname, subject, etc.

3
Falconide API Guide Version 2.1

2.2 Syntax for an API call

The general syntax of an API call is shown here:

<API URL> [value] </API URL>


<API key> [value] <API key/>
<INPUT>
<Parameter 1> [value] </parameter1>
<Parameter 2> [value] </parameter2>
</INPUT>

3. Falconide API Library

Here is the list of APIs offered by Falconide. These are explained in detail later in the document.

1. Sending Emails
2. Templates: Add, Edit, Preview
3. Domain : Add domain, Whitelist and Blacklist emails IDs and domains
4. Jobs: View status, Update, Delete
5. Reports

4
Falconide API Guide Version 2.1

4. Sending Emails
Falconide can receive emails through SMTP and HTTP as well. After processing the email, it sends the email to the target server via Internet through SMTP only.

SMTP is a standard protocol, relatively simpler to implement, and it sends one email per API call.

HTTP API is custom-developed by Falconide, is more sophisticated, and can send up to 1000 emails per API call.

You can use the HTTP API in cases where the same email needs to be sent to multiple recipients.

If you wish to send the same content to multiple recipients, you can use a single API. One API call can suffice for multiple email addresses, helping in significant saving of
bandwidth costs.

SMTP based API Call for email Sending:

SMTP API allows you to deliver custom handling instructions for email. You can categorize your emails with tags like Sign up, Confirmation emails, etc. to get
detailed statistics on each tag. You can tag the emails by inserting X-TAGS in the header of the message.

You can also track each message with an Identifier. Pass the required tracking data under the X-APIHEADER. The X-APIHEADER header is a JSON-encoded
associative array.

Here is a sample:

X-APIHEADER: { transID => [‘282747328’],};


X-TAGS: Account Deactivation, Verification;

5
Falconide API Guide Version 2.1

SMTP is a fast way to get started since it requires very few changes.

To set up SMTP API call:

a. Change your SMTP user name and password as per the credentials provided to you.
b. Set the server host name to smtp.Falconide.com.
c. Use port number 25, 587, or 465 for sending emails over SSL connections.

a. JSON API
Input Parameters

Name Required Type Description


api_key Yes string Your unique api key
fromname No string Email Sender name
subject Yes string subject of the email
from Yes string Sender’s email address
replytoid No string email address where recipients reply will be received.
content Yes string Content of the email
files No string the attachments to be used in sending an email
footer no boolean 0 or 1 to disable or enable the footer respectively
template no string template ID to be used while sending an email
attachmentID No integer already uploaded attachments ID
clicktrack No boolean to zero or one to disable or enable the click-track respectively
opentrack No boolean zero or one to disable or enable the open-track respectively
bcc No string BCC email address to be used while sending an email
unsubscribe No boolean zero or one to disable or enable unsubscribe respectively
recipients Yes string Array of recipients email addresses, to whom the mail will be sent. Multiple recipients are allowed.
recipients_cc No string Array of recipients email addresses which need to be added in CC. Multiple recipients are allowed.
attributes No string attributes for recipients to send personalized email. Multiple attributes are allowed.

6
Falconide API Guide Version 2.1
X-APIHEADER No string Array of user-defined unique identifier for each recipients email addresses. The length of X-
APIHEADER cannot be more than 255 characters.
X-APIHEADER_CC No string Array of user-defined unique identifier for each recipients email addresses which were added under
recipients_cc as CC. The length of X-APIHEADER_CC cannot be more than 255 characters.
tags No string This can be used to tag/label each emails, in order to categorize for reports and other purposes. Use
comma to separate multiple values.

Notes:

 Fromname, subject, and content need to be raw URL encoded.


 Files : Name and content of the files must be provided. The file content needs to be base64 encoded or raw URL encoded, preferably, base64
encoded to avoid performance issues. Multiple file attachments are allowed.

Response parameters

Parameter Description
message On Success : Success , On Failure : Error
errorcode specifies error code
errormessage indicates error message

JSON API Call Format

Input:

Host: http://api.falconide.com
Content-Type: application/json
POST /api/web.send.json HTTP/1.1
{
"api_key":"yourapikey",
"email_details":{
"fromname":"sender name",
"subject":"test email subject",
"from":"[email protected]",
"replytoid": "[email protected]",
"content":"<p>Hi [%NAME%], This is a test email sent using Falconide JSON/Email API</p>"
},
7
Falconide API Guide Version 2.1
"tags": "AccountDeactivation, Verification",
"X-APIHEADER": ["ID3","ID2"],
"X-APIHEADER_CC": ["ID6","ID7"],
"settings":{
"footer":"1",
"clicktrack":"1",
"opentrack":"1",
"unsubscribe":"1",
"bcc":"[email protected]",
"attachmentID":"1,3,4",
"template":"101",
},
"recipients":["[email protected]","[email protected]"],
"recipients_cc":["[email protected]","[email protected]"],
"attributes":{
"NAME":["NameOfFirstRecipient","NameOfSecondRecipient"],
"AGE":["20","30"]
},
"files": {
"attachment_example1.txt": "VGhpcyBpcyB0aGUgY29udGVudCBvZiBhIHRlc3QgZmlsZS4K",
"attachment_example2.txt": "VGhpcyBpcyB0aGUgY29udGVudCBvZiBhIHRlc3QgZmlsZSAyLgo="
}
}

Output:

On Success -

{"message":"SUCCESS","errorcode": "0" ,"errormessage":""}

On Failure -

{"message":"ERROR","errorcode": "102" ,"errormessage":"InvalID API key used in API call.Hence authentication failed."}

Sample JSON API Call

Input:

http://api.falconide.com/falconapi/web.send.json?data=
{"api_key": "49fbb3455c086argcf9ssse739a1755a","email_details": {"fromname": "Testing Falconide","subject": "Welcome to our falconide product","from":
"[email protected]","content": "This is test mail"},"recipients": ["[email protected]"],"X-APIHEADER": ["ACC123", "SE2532"]}
Output:

8
Falconide API Guide Version 2.1
{"message":"SUCCESS","errorcode": "0" ,"errormessage":""}

b. REST

Input Parameters

Name Required Type Description


api_key Yes string Your unique api key

fromname No string Email Sender name


subject Yes string subject of the email
from Yes string Sender’s email address
replytoid No string email address where recipients reply will be received.
content Yes string Content of the email
files No string the attachments to be used in sending an email
footer no boolean zero or one to disable or enable the footer respectively
template no string template ID to be used while sending an email
attachmentID No string already uploaded attachments ID
clicktrack No boolean to zero or one to disable or enable the click-track respectively
opentrack No boolean zero or one to disable or enable the open-track respectively
bcc No string BCC email address to be used while sending an email
unsubscribe No boolean zero or one to disable or enable unsubscribe respectively
recipients Yes string Array of recipients email addresses, to whom the mail will be sent. Multiple
recipients are allowed.
recipients_cc No string Array of recipients email addresses which need to be added in CC. Multiple
recipients are allowed.
attributes No string attributes for recipients to send personalized email. Multiple attributes are
allowed.
X-APIHEADER No string User-defined unique Identifier for each email. The length of X-APIHEADER cannot
be more than 255 characters.
X-APIHEADER_CC No String Array of user-defined unique identifier for each recipients email addresses which
were added under recipients_cc as CC. The length of X-APIHEADER_CC cannot be
more than 255 characters.
9
Falconide API Guide Version 2.1
tags No string This can be used to tag/label each emails, in order to categorize for reports and
other purposes. Use comma to separate multiple values.
Response parameters

Parameter Description
message On Success : Success , On Failure : Error
errorcode specifies error code
errormessage indicates error message
REST API Call Format

Input:

HTTP/1.1
Content-Type: application/json
GET http://api.falconide.com/api/web.send.rest?
api_key=yoursecretkey
&subject=yourtestsubject
&fromname=yourfromname
&[email protected]
&[email protected]
&X-APIHEADER=ACC123,SE2532
&X-APIHEADER_CC=ID1,ID2
&tags=AccountDeactivation,Verification
&content=YourEmailContent
&[email protected],[email protected]
&[email protected],[email protected]
&footer=1
&template=123
&[email protected]
&attachmentID=1,2
&clicktrack=1
&ATT_NAME=NameOfRecipient1,NameOfRecipient2
&ATT_AGE=12,25
Output:

{"message":"SUCCESS","errorcode": "0" ,"errormessage":""}

Sample REST API Call

Input

10
Falconide API Guide Version 2.1
http://api.falconide.com/falconapi/web.send.rest?
api_key=6301eb4f3asde6dader334ad15fd1ase
&opentrack=1
&clicktrack=1
&content=%22This%20is%20test%20mail%22
&subject=TestingAPI
&fromname=Test
&[email protected]
&[email protected]
&X-APIHEADER=1234
Output

{"message":"SUCCESS","errorcode": "0" ,"errormessage":""}

5. Template

This module enables you to create and manage your email templates. You can: Add, Edit, and Preview templates.

a. Add Template
This API enables you to add email templates.

JSON API
Input parameters

Name Required Type Description


api_key Yes string Your unique api key
templatename Yes string Template name required while creating a template.
content Yes string Content to be used while sending an email. Content needs to be raw URL encoded.
Response parameters

Parameter Description
message On Success : Success , On Failure : Error
errorcode specifies error code
errormessage indicates error message

11
Falconide API Guide Version 2.1
JSON API Call Format
Input:
http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key":"<api_key>",
"type" : "templateadd",
"templatename" : "<sample_template_name>",
"content" : "<template_content>"
}

Output:

On Success -

{
"status": "success",
"templateid": "1922",
"message": "Data added successfully in Falconide."
}

On Failure -

{
"status": "error",
"message": "error adding template" // If Template name already exists
}

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key":"43dd4743ad54brtadw13rad45667",
"type" : "templateadd",
"templatename" : "Sample Template",
"content" : "This is a sample template"
}

12
Falconide API Guide Version 2.1

b. Edit Template
This API enables you to edit the templates.

JSON API
Input parameters

Name Required Type Description


api_key Yes string Your unique api key
templatename Yes string Template name required while creating a template.
content Yes string Content to be used while sending an email. Content needs to be raw URL encoded.
templateid Yes integer Template ID to be used while editing the template content. Only one template id can be specified.
Response parameters

Parameter Description
message On Success : Success , On Failure : Error
errorcode specifies error code
errormessage indicates error message

JSON API Call Format

13
Falconide API Guide Version 2.1
Input:

http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key":"<api_key>",
"type" : "templateadd",
"templatename" : "<sample_template_name>",
"content" : "<template_content>",
"templateid" : "<template_id>"

Output:

On Success -

{
"status": "success",
"message": "Data updated successfully in Falconide."
}
On Failure -

{
“status": "error",
"message": "error adding template //If Template id or Template name is missing
}

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key":"43dd4743ad54brtadw13rad45667",
"type" : "templateadd",
"templatename" : "This is a sample",
"content" : "The sample has been edited",
"templateid" : "3771"
}

c. Preview Template

14
Falconide API Guide Version 2.1
This API enables you to preview the templates.

JSON API
Input parameters

Name Required Type Description


api_key Yes string Your unique api key
templateid Yes string Template ID to be used while editing the template content. Only one template id can be specified.

Response parameters

Parameter Description
message On Success : Success , On Failure : Error
errorcode specifies error code
errormessage indicates error message

JSON API Call Format

Input:

http://admin.falconide.com/falconapi/manage.falconide?data=
{
api_key:<api_key>,
type:<templatedownload>,
templateid:<template_id>
}
Output:

On Success -

{
“status": "error",
"message": "No template found for you" //Invalid Template id
}

15
Falconide API Guide Version 2.1

On Failure -

{
“status": "error",
"message": "Missing template id"

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key": "43dd4743ad54brtadw13rad45667",
"type": "templatedownload",
"templateid": “1923”
}

6. Domain

Using the APIs in this section, you can Add a domain, Whitelist or Blacklist existing domains and email IDs.

a. Add Domain
This API module enables you to add domains which can be used for sending emails.

JSON API
Input Parameters

Name Required Type Description


api_key Yes string Your unique api key
domainname Yes string Name of the domain
type Yes String The task that you want to achieve –add domain, whitelist domain, blacklist domain, whitelist email ID,
blacklist email ID

16
Falconide API Guide Version 2.1
Response parameters

message On Success : Success , On Failure : Error


errorcode specifies error code
errormessage indicates error message

JSON API Call Format

Input:

http://admin.falconide.com/falconapi/manage.falconide?data=
{
"api_key":"<api_key>",
"type" : "domadd",
"domainname" : "<sample_domain>"
}
Output:

On Success -

{
"status": "success",
"message": "Data updated successfully in Falconide."
}
On Failure -

{
"status": "error", // domain already exists
"message": "Domain is already in use"
}

17
Falconide API Guide Version 2.1

Sample JSON API Call

Input:

http://admin.falconide.com/falconapi/manage.falconide?data=
{"api_key":"49fbb3455c086argcf9ssse739a1755a",
"type" : "domadd",
"domainname" : "m3m.in"}
Output:

{"status":"success","message":"Data updated successfully in Falconide."}

b. Whitelist Domain
This API is to whitelist previously blacklisted domains.

JSON API Call Format

Input:

http://admin.falconide.com/falconapi/manage.falconide?
data=
{“api_key” : “<api key>”,
“type” : “domainwhitelist”,
“emaildomain” : “<domain to be whitelisted>” }

Output:

On Success -

{"status":"success","message":"Domain successfully whitelisted in Falconide."}

On Failure -

{"status":"error","message":"Missing email domain"}

18
Falconide API Guide Version 2.1

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?
data=
{"api_key" : "43dd4743ad54b20sdsfa44545676554",
"type" : "domainwhitelist",
"emaildomain" : "nstest.in" }

c. Blacklist Domain
This API is to blacklist domains.

JSON API Call format

http://admin.falconide.com/falconapi/manage.falconide?
data=
{“api_key” : “<api key>”,
“type” : “domainblacklist”,
“emaildomain” : “<domain to be blacklisted>” }

Output

On Success -

{"status":"success","message":"Domain successfully blacklisted in Falconide."}

On Failure -

{"status":"error","message":"Missing email domain"}

19
Falconide API Guide Version 2.1
Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?
data=
{"api_key" : "43dd4743ad54b20eb446b060289df555",
"type" : "domainblacklist",
"emaildomain" : " nstest.in " }

d. Whitelist Email ID
This API is to whitelist previously blacklisted email IDs.

JSON API Call Format

http://admin.falconide.com/falconapi/manage.falconide
data=
{'api_key' :<api key>,
'type' : 'emailwhitelist',
'email' : ‘<email ID to be whitelisted>' }

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?
data=
{"api_key" : "43dd4743ad54b20eb446b560289df555",
"type" : "emailwhitelist",
"email" : "[email protected]" }

e. Blacklist Email ID
This API enables you to blacklist email IDs.
20
Falconide API Guide Version 2.1
JSON API Call Format

http://admin.falconide.com/falconapi/manage.falconide?
data=
{“api_key” : “<api key>”,
“type” : “emailblacklist”,
“email” : “<email ID to be blacklisted>” }

Sample JSON API Call

http://admin.falconide.com/falconapi/manage.falconide?
data=
{“api_key” : “43dd4743ad54b20eb446b060289df555”,
“type” : “emailblacklist”,
“email” : “[email protected]” }

7. Job

These APIs enable you to perform activities associated with Jobs.

a. View Status
You can view the status of a particular job ID.

Input Parameters

Name Required Type Description


ApiKey Yes string Your unique api key
JOBID Yes integer Job Id for which status is to be checked.

Response Parameters

Parameter Description
JOBID Job id requested
Status Status of the job.
Entered Date when the job was added.

21
Falconide API Guide Version 2.1

XML format

Input

http://app.falconide.com/falconapi/index.php?type=job&activity=Status&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>Value</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>Value</JOBID>
</INPUT>
</DATASET>

Output

<DATASET>
<TYPE>success</TYPE>
<OUTPUT>
<JOBID>Value</JOBID>
<Status>Value</Status>
<Entered>Value</Entered>
</OUTPUT>
</DATASET>
Sample XML Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Status&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>6301eb4f3ab96d9a5b21565af154d1dd</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>1</JOBID>
</INPUT>
</DATASET>

JSON format

http://app.falconide.com/falconapi/index.php?type=job&activity=Status&calltype=json&data=
{
"CONSTANT": {

22
Falconide API Guide Version 2.1
"ApiKey":"<Api_key>"
},
"INPUT": {
"JOBID":"<jobid>"
}
}

Sample JSON API Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Status&calltype=json&data=
{
"CONSTANT": {
"ApiKey":"6301eb4f3ab96d9a5b21565af154d1dd"
},
"INPUT": {
"JOBID":"2659"
}
}

b. Update
This API enables you to update an existing job.
Input parameters

Name Required Type Description


ApiKey Yes string Your unique api key
JOBID Yes string ID of the job whose details need to be updated.

NotifyEmail Yes string Specify the email address to which you want to receive the notification of the job status. You can
provide multiple email addresses, separated by commas
CallbackUrl Yes string Specify the URL to which output is to be posted.

Response Parameters

Parameter Description
JOBID Job id requested
23
Falconide API Guide Version 2.1

XML Format

Input

http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>Value</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>Value</JOBID>
<NotifyEmail>Value</NotifyEmail>
<CallbackUrl>Value</CallbackUrl>
</INPUT>
</DATASET>

Output

<DATASET>
<TYPE>success</TYPE>
<OUTPUT>
<JOBID>Value updated.</JOBID>
</OUTPUT>
</DATASET>

Sample XML Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>6301eb4f3ab96d9a5b21565af154d1dd</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>1</JOBID>
<NotifyEmail>[email protected]</NotifyEmail>
<CallbackUrl>http://xyz.com/test.php</CallbackUrl>
</INPUT>
</DATASET>

JSON API format


24
Falconide API Guide Version 2.1
http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=json&data=
{
"CONSTANT": {
"ApiKey":"<api_key>"
},
"INPUT": {
"JOBID":"<jobid>",
"NotifyEmail":"<email>",
"CallbackUrl":"<url>"
}
}

Sample JSON API Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=json&data=
{
"CONSTANT": {
"ApiKey":"6301eb4f3ab96d9a5b21565af154d1dd"
},
"INPUT": {
"JOBID":"1",
"NotifyEmail":"[email protected]",
"CallbackUrl":"http://xyz.com/test.php"
}
}

c. Delete
This API enables you to delete the jobs. The input parameter is:

Name Required Type Description


ApiKey Yes string Your unique api key

JOBID Yes string ID of the job whose details need to be removed/deleted. You can provide multiple job ids, separated by
commas.

The output parameter is JOBID - Job ID(s) to be removed.

XML format

Input

25
Falconide API Guide Version 2.1
http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>Value</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>Value</JOBID>
</INPUT>
</DATASET>

Output

<DATASET>
<TYPE>success</TYPE>
<OUTPUT>
<RECORD><JOBID>48</JOBID><Status>Deleted</Status></RECORD>
</OUTPUT>
</DATASET>

Sample XML Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Delete&calltype=xml&data=
<DATASET>
<CONSTANT>
<ApiKey>6301eb4f3ab96d9a5b21565af154d1dd</ApiKey>
</CONSTANT>
<INPUT>
<JOBID>1</JOBID>
</INPUT>
</DATASET>

JSON API format

http://app.falconide.com/falconapi/index.php?type=job&activity=Update&calltype=json&data=
{
"CONSTANT": {
"ApiKey":"<api_key>"
},
"INPUT": {
"JOBID":"<job_id>"}
}

26
Falconide API Guide Version 2.1
Sample JSON API Call

http://app.falconide.com/falconapi/index.php?type=job&activity=Delete&calltype=json&data=
{
"CONSTANT": {
"ApiKey":"6301eb4f3ab96d9a5b21565af154d1dd"
},
"INPUT": {
"JOBID":"1"}
}

8. Report

This API enables you to download the report of each email transaction happening through Falconide.

Input Parameters:

Name Required Type Description


ApiKey Yes string Your unique api key
StartDate Yes string Used for searching reports within a date range.
EndDate Yes string Used for searching reports within a date range. If no date criteria is defined last one year data is
retrieved.
processed No boolean Number of mails in sent state. The value of this parameter can be 0 or 1.
Open No boolean Number of mails in opened state. The value of this parameter can be 0 or 1.
Click No boolean Number of mails in clicked state. The value of this parameter can be 0 or 1.
Unsubscribe No boolean Number of mails in unsubscribe state. The value of this parameter can be 0 or 1.
Bounce No boolean Number of mails in bounce state. The value of this parameter can be 0 or 1.
SoftBounce No boolean Number of mails in soft bounce state. The value of this parameter can be 0 or 1.
HardBounce No boolean Number of mails in hard bounce state. The value of this parameter can be 0 or 1.
Spam No boolean Number of mails in spam state. The value of this parameter can be 0 or 1.
Invalid No boolean Number of mails in invalid state. The value of this parameter can be 0 or 1.

27
Falconide API Guide Version 2.1
Dropped No boolean Number of mails in dropped state. The value of this parameter can be 0 or 1.
NotifyEmail Yes string Specify the email address to which the report download link has to be sent.
callbackUrl Yes string Specify the call back URL to which the downloaded report file is to be posted. The callback URL can
be either http(s) or ftp.

Note: If the parameters from Processed through Dropped are not defined, then the API call searches for all the emails sent in the specified timespan.

Response Parameters

Jobid: This tag provides the job id using which the status and other information on the job can be fetched.

Input XML format

<DATASET>
<CONSTANT>
<ApiKey>Value</ApiKey>
</CONSTANT>
<CRITERIA>
<StartDate>Value</StartDate>
<EndDate>Value</EndDate>
</CRITERIA>
<INPUT>
<Processed>1/0</Processed>
<Sent>1/0</Sent>
<Open>1/0</Open>
<Click>1/0</Click>
<Unsubscribe>1/0</Unsubscribe>
<Bounce>1/0</Bounce>
<SoftBounce>1/0</SoftBounce>
<HardBounce>1/0</HardBounce>
<Spam>1/0</Spam>
<Invalid>1/0</Invalid>
<Dropped>1/0</Dropped>
<NotifyEmail>Value</NotifyEmail>
<CallbackUrl>Value</CallbackUrl>
</INPUT>

28
Falconide API Guide Version 2.1
Output XML

<DATASET>
<TYPE>success</TYPE>
<RECORD>
<Jobid>Value</Jobid>
</RECORD>
< /DATASET>

Sample XML Call

http://app.falconide.com/falconapi/index.php?type=report
&activity=DownloadLog
&calltype=xml
&data=
<DATASET><CONSTANT><ApiKey>6301eb4f3ab96d9a5b215623445ada</ApiKey>
<RefIp></RefIp><RefWeb></RefWeb></CONSTANT>
<CRITERIA>
<StartDate>2014-07-25</StartDate>
<EndDate>2014-07-25</EndDate>
</CRITERIA>
<INPUT><Processed>1</Processed>
<Sent>1</Sent>
<Open>1</Open>
<Click>1</Click>
<Unsubscribe>1</Unsubscribe>
<Bounce>1</Bounce>
<SoftBounce>1</SoftBounce>
<Spam>1</Spam>
<Invalid>1</Invalid>
<Dropped>1</Dropped>
<HardBounce>1</HardBounce>
<NotifyEmail>[email protected]</NotifyEmail>
<CallbackUrl></CallbackUrl>
</INPUT>
</DATASET>

JSON API format

http://app.falconide.com/falconapi/index.php?
type=report&activity=DownloadLog&calltype=json&data=
{
"CONSTANT":{
29
Falconide API Guide Version 2.1
"ApiKey": "<you api key>"
},

"CRITERIA": {
"StartDate": "<start date>",
"EndDate": "<end date>"
},
"INPUT": {
"Processed": "1/0",
"Sent": "<1/0>",
"Open": "<1/0>",
"Click": "<1/0>",
"Unsubscribe": "<1/0>",
"Bounce": "<1/0>",
"SoftBounce": "<1/0>",
"HardBounce": "<1/0>",
"Spam": "<1/0>",
"Invalid": "<1/0>",
"Dropped": "<1/0>",
"NotifyEmail": "<notification email ID>"
}
}
Output JSON

{"DATASET":
{
"TYPE":"success",
"RECORD":
{
"Jobid":Value
}
}
}

Sample JSON API Call

http://app.falconide.com/falconapi/index.php?
type=report&activity=DownloadLog&calltype=json&data=
{
"CONSTANT":{
"ApiKey": "6301eb4f3asde6dader334ad15fd1dd"
},

"CRITERIA": {
"StartDate": "2016-08-01",
"EndDate": "2016-08-10"

30
Falconide API Guide Version 2.1
},
"INPUT": {
"Processed": "1",
"Sent": "1",
"Open": "1",
"Click": "1",
"Unsubscribe": "1",
"Bounce": "1",
"SoftBounce": "1",
"HardBounce": "1",
"Spam": "1",
"Invalid": "1",
"Dropped": "1",
"NotifyEmail": "[email protected]"
}
}

Format of the downloaded Report

Report download is available in zip format and the job id for the report request is the report file name. The zip file comprises a CSV file with the requested data.

For example, if the job id for the report request is 4109, the zip file of the report is named as 4109.zip.

The format of the sample report is:

Tr- X- To Email From Email Requested Modified Date Mail Status Remarks
ID APIHEADER Address Address On Size
(KB)

7 {“3001”} sa1@gmail info@ymail. 2013-12- 2013-12-01 4Kb Sent 202.162.242


.com com 01 11:11:22 .176-> 250
11:11:21 2.0.0 OK

31
Falconide API Guide Version 2.1

4 {"2001”} sa2@gmail info@ymail. 2013-12- 2013-12-02 2Kb Click 202.162.242


.com com 01 11:11:21 .176-> 250
11:01:10 2.0.0 OK

2 {“5001”} sa3@gmail info@ymail. 2013-12- 2013-12-01 8Kb Sent 202.162.242


.com com 01 11:00:11 .176-> 250
11:00:11 2.0.0 OK

Tagwise Summary Report


This API enables you to download the tagwise summary report.

Input parameters

Name Required Type Description


api_key Yes string Your unique api key
Type Yes string It specifies the type of report. Here, the value is tagwise.
From Yes date Start date of the report.
To Yes date The end date of the report.

Sample JSON API Format

Input:

http://api.falconide.com/falconapi/reports.falconide?data=
{
"api_key" : "your_api_key",
"type":"tagwise",
"from":"2016-01-01",
"to":"2016-06-05"
}

Output:
32
Falconide API Guide Version 2.1
{
"tag_sumary":{"2016-07-01":{"SIGNUP_MAILER":{"adate":"2016-07-01",
"bounce":"10587",
"unique_open":"10723","unique_click":"1951",
"open":"15277","unsub":"0",
"dropped":"0","click":"2882",
"fbl_abuse":"1","tag":"SIGNUP_MAILER",
"sent":"80360","invalid":"0"},
"EORS_WISHLIST":{"adate":"2016-07-01",
"bounce":"79","unique_open":"16528",
"unique_click":"0","open":"20178",
"unsub":"60","dropped":"0",
"click":"0","fbl_abuse":"0",
"tag":"EORS_WISHLIST","sent":"421861",
"invalid":"0"},"SIGNUP_MAILER_EORS":{"adate":"2016-07-01",
"bounce":"4459","unique_open":"4483",
"unique_click":"0","open":"4853",
"unsub":"0","dropped":"0",
"click":"0","fbl_abuse":"0",
"tag":"SIGNUP_MAILER_EORS","sent":"40453",
"invalid":"0"}}},"status":"success"
}

9. Error Codes

Here is the error code list:

Error Code Description Event


101 IP address marked as blacklisted If IP address is marked as blacklisted by
FALCONIDE Team
104 API key not passed API Key not available
105 Invalid API Key
106 API call limit exceeded Number of API calls exceeds allowed limit
107 Your IP address is not allowed
1102 Invalid API call Generic error

33
Falconide API Guide Version 2.1

1103 Invalid call Type specified If call type is not defined as xml or json
(JSON/XML).
1104 Invalid date format specified. If start date and end date specified is not
Required format is "Y-m-d" in required format
1105 Invalid date range specified If start date is less than end date
1106 Response parameters not specified If neither call back URL nor email-address
is specified
1107 Invalid email address specified for If email address specified for response
handling response handling is invalid
1109 Error creating job. Please try again Generic error
after some time
1111 Call back URL specified is not If call back URL is not reachable
reachable
1112 Invalid Job ID passed If job ID to be queried is invalid
1113 Cannot delete job since not in If job id to be deleted is not in queued
queued state state

10. Support

If you have a question, call +91-(22)-66628081.

You may also submit a request online using your Falconide Account or else drop a mail to [email protected].

34

You might also like