Manage Your Campaign Activity

Mandatory Parameters -
authtoken*
scope*

Response Formats

  • XML
  • JSON

Note

  • The default response format for all the APIs will be XML format

Recent Campaign

Use our API Authentication Token (authtoken) to view recent campaigns in an account. Irrespective of what status campaigns are in - be it draft, sent, stopped, canceled or more, we would let you know the status of all the campaigns.

Request URL:

https://campaigns.zoho.com/api/recentcampaigns

Request Type: Get

Parameters:

Parameter Data Type Description
authtoken*
scope*
String
String
API Authentication Token
CampaignsAPI
limit* Integer Limit to fetch recent campaigns from campaigns list
version String This will fetch responses based on the current API version
resfmt String XML (or) JSON

* - Mandatory Parameter

Sample Request:
https://campaigns.zoho.com/api/recentcampaigns?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]

Sample Response:

Our API response will let you know of the following, be it in the XML or JSON format:

XML Format:

<response uri="/api/recentcampaigns" version="1"><br/>
<status>success</status><br/>
<code>0</code><br/>
<recent-campaigns><br/>
<campaign no="1"><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b99f747d905612a4b</fl><br/>
<fl val="sent_time">1342503703000</fl><br/>
<fl val="campaign_status">Sent</fl><br/>
<fl val="created_time">1342503640000</fl><br/>
</Campaign><br/>
<campaign no="2"><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b56febfd0cb811b03</fl><br/>
<fl val="sent_time">1342503459000</fl><br/>
<fl val="campaign_status">Sent</fl><br/>
<fl val="created_time">1342503425000</fl><br/>
</campaign><br/>
<campaign no="3"><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b2bf0c3fb3e40110b</fl><br/>
<fl val="sent_time">1342502423000</fl><br/>
<fl val="campaign_status">Sent</fl><br/>
<fl val="created_time">1342502300000</fl><br/>
</campaign><br/>
<campaign no="4"><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b1f0db88921e34a27</fl><br/>
<fl val="campaign_status">Draft</fl><br/>
<fl val="created_time">1342502300000</fl><br/>
</campaign><br/>
<campaign no="5"><br/>
<fl val="campaign_name">123</fl><br/>
<fl val="campaign_key">34594177d382061bc947299b74895e93</fl><br/>
<fl val="campaign_status">Draft</fl><br/>
<fl val="created_time">1342501243000</fl><br/>
</campaign><br/>
</recent-campaigns><br/>
</response>

JSON format:

{"status":"success","recent_campaigns":"[{campaign_name=CAMPAIG, campaign_key=34594177d382061b99f747d905612a4b, sent_time=1342503703000, campaign_status=Sent, created_time=1342503640000}, {campaign_name=CAMPAIG, campaign_key=34594177d382061b56febfd0cb811b03, sent_time=1342503459000, campaign_status=Sent, created_time=1342503425000}, {campaign_name=CAMPAIG, campaign_key=34594177d382061b2bf0c3fb3e40110b, sent_time=1342502423000, campaign_status=Sent,created_time=1342502300000}, {campaign_name=CAMPAIG, campaign_key=34594177d382061b1f0db88921e34a27, campaign_status=Draft, created_time=1342502300000}, {campaign_name=123, campaign_keyy=34594177d382061bc947299b74895e93, campaign_status=Draft, created_time=1342501243000}]","code":"0","uri":"/api/recentcampaigns","version":"1"}

Recently Sent Campaign

You might want to reflect campaign data in your website. Use our API Authentication Token (authtoken) to view the email campaign that was recently sent. Using this API will help you fetch details only of the recently sent campaign and not other campaign(s) in different statuses.

Request URL:

https://campaigns.zoho.com/api/recentsentcampaigns

Request Type: Get

Parameters:

Parameter Data Type Description
authtoken*
scope*
String
String
API Authentication Token
CampaignsAPI
limit* Integer Limit to fetch Recent campaigns from campaigns list
version String This will fetch responses based on the current API version
resfmt String XML (or) JSON

* - Mandatory Parameter

Sample Request:
https://campaigns.zoho.com/api/recentsentcampaigns?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]

Sample Response:
Our API response will let you know of the following be it in the XML or JSON format:

XML Format:

<response uri="/api/recentsentcampaigns" version="1"><br/>
<status>success</status><br/>
<code>0</code><br/>
<recent-sent-campaigns><br/>
<campaign no="1"><br/>
<fl val="sent_time">1342503703000</fl><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b99f747d905612a4b</fl><br/>
<fl val="created_time">1342503640000</fl><br/>
</campaign><br/>
<campaign no="2"><br/>
<fl val="sent_time">1342503459000</fl><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b56febfd0cb811b03</fl><br/>
<fl val="created_time">1342503425000</fl><br/>
</campaign><br/>
<campaign No="3"><br/>
<fl val="sent_time">1342502423000</fl><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="campaign_key">34594177d382061b2bf0c3fb3e40110b</fl><br/>
<fl val="created_time">1342502300000</fl><br/>
</campaign><br/>
</recent-sent-campaigns><br/>
</response>

JSON Format:

{"recent_sent_campaigns":"[{sent_time=1342503703000, campaign_name=CAMPAIG, campaign_key=34594177d382061b99f747d905612a4b, created_time=1342503640000}, {sent_time=1342503459000, campaign_name=CAMPAIG, campaign_key=34594177d382061b56febfd0cb811b03, created_time=1342503425000}, {sent_time=1342502423000, campaign_name=CAMPAIG, campaign_key=34594177d382061b2bf0c3fb3e40110b, created_time=1342502300000}]","status":"success","code":"0","uri":"/api/recentsentcampaigns","version":"1"}

Campaign Reports

Urged to analyze statistical reports and the effectiveness of your email campaign? It’s easy, no one has to share reports to you, nor do you have to log in, use our API Authentication Token (authtoken) and view the campaign report of a particular email campaign.

Request URL:

https://campaigns.zoho.com/api/getcampaignreports

Request Type: Get

Parameters:

Parameter Data Type Description
authtoken*
scope*
String
String
API Authentication Token
CampaignsAPI
campaignkey* String Fetch campaigns reports from campaign list (You can get the campaignkey from the recently sent campaign API.)
version String This will fetch responses based on the current API version
resfmt String XML (or) JSON

* - Mandatory Parameter

Sample Request:
https://campaigns.zoho.com/api/getcampaignreports?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&campaignkey=[campaignkey]

Sample Response:
Our API response will let you know of the following be it in the XML or JSON format:

XML Format

<response uri="/api/getcampaignreports" version="1"><br/>
<status>success</status><br/>
<code>0</code><br/>
<campaign-reports><br/>
<fl val="spams_count">0</fl><br/>
<fl val="clicks_count">2</fl><br/>
<fl val="opens_count">2</fl><br/>
<fl val="forwards_count">0</fl><br/>
<fl val="campaign_name">CAMPAIG</fl><br/>
<fl val="emails_sent_count">2</fl><br/>
<fl val="optouts_count">0</fl><br/>
<fl val="bounces_count">0</fl><br/>
</campaign-reports><br/>
</response>

JSON format:

{"status":"success","clicks_count":"2","opens_count":"2","campaign_name":"CAMPAIG",
"code":"0","uri":"/api/getcampaignreports","optouts_count":"0",
"bounces_count":"0","version":"1","spams_count":"0",
"forwards_count":"0","emails_sent_count":"2"}

Error Codes

We’ve a set of error codes which has certain values that are:

Code values
0 SUCCESS
1001 Pattern doesn't match
1002 Extra parameter found
1003 No mandatory fields in this URL
1004 Wrong URL entered
1005 Please enter correct data type format
1006 Multiple key entries are not supported
1007 Unauthorized request
6101 No campaigns are available in this view
6201 No campaigns are available in this view
6001 Error in displaying reports. Please retry after sometime
6002 Invalid Campaign key