Zoho Campaigns允许您无需登录即可执行宣传推广操作。而且,这就是为什么我们会提供API密钥。这是很容易和简洁的。您可以查看数据相关的2个操作,即:
当您调用您的请求时,要输入一组必须使用的参数类型。这些类型在不同情况下将是不同的。使用我们的API密钥来跟踪一个宣传推广或一个列表发生了什么。
然而,用户在请求期间可以定义一些特定格式的响应。所用到的2种类型是作为默认响应类型的XML(或)JSON(若在请求期间声明了的话)。
既然如此,开始:
用户可以不通过使用注册表或添加一个联系人来订阅列表。他们可以使用我们的API密钥订阅并且添加的用户会被通知。
Unlike the request URL formats in the above operations, you've an option of XML (or) JSON here at the time of request.
XML: https://campaigns.zoho.com/api/xml/listsubscribe.do
JSON: https://campaigns.zoho.com/api/json/listsubscribe.do
Request Type: Post
Parameters:
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API key to access account API key to access account (Campaigns API) |
listkey* | String | List Api Key to send a subscription mail to Contacts |
version | String | This will fetch responses based on the current API version |
resfmt | String | XML (or) JSON |
contactInfo | XML (or) JSON | Contact email with other fields. Format of this value depends on the request URL. |
* - Mandatory Parameters
https://campaigns.zoho.com/api/xml/listsubscribe?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&listkey=[ListApiKey]&contactinfo=macjay@testcmp.zoho.com
https://campaigns.zoho.com/api/json/listsubscribe?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&listkey=[ListApiKey]&contactinfo={First Name:mac,Last Name:Last Name,Contact Email:jai@zoho.com}
Our API response will let you know of the following be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
Code - Your error code in the response.
We’ve a set of codes that has certain values which 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 key |
2001 | Error in subscription. Please retry after sometime |
2002 | Iist key is empty or Invalid List key |
2003 | Contact exists in this list |
<response uri="/api/xml/listsubscribe" version="1">
<code>0</code>
<status>success</status>
<message>A confirmation email is sent to the user. User needs to confirm to successfully subscribe.</message>
</response>
{"message":"A confirmation email is sent to the user. User needs to confirm to successfully subscribe.","status":"success","code":"0","uri":"/api/json/listsubscribe","version":"1"}
Not interested in being part of the email subscription? Never mind, all you need to do is enter the API key to unsubscribe and the user will be notified.
XML: https://campaigns.zoho.com/api/xml/listunsubscribe
JSON: https://campaigns.zoho.com/api/json/listunsubscribe
Request Type: Post
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API key to access your account API key to access your account (Campaigns API) |
listkey* | String | List Api Key use to Unsubscribe Contacts |
version | String | This will fetch responses based on the current API version |
resfmt | String | XML (or) JSON |
contactInfo | XML (or) JSON | Contact email with other fields. Format of this value depends on the request URL. |
* - Mandatory Parameters
XML:
https://campaigns.zoho.com/api/xml/listunsubscribe?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&listkey=[ListApiKey]&contactinfo=<xml><fl val="First Name">mac</fl><fl val="Contact Email">jai@zoho.com</fl></xml>
JSON:
https://campaigns.zoho.com/api/json/listunsubscribe?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&listkey=[ListApiKey]&contactinfo={First name:mac,Last Name:Last Name,Contact Email:jai@zoho.com}
Our API response will let you know of the following be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
Code - Your error code in the response.
We’ve a set of codes that has certain values which 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 key |
2101 | Error in unsubscription. Please retry after sometime |
2102 | Listkey is empty or Invalid Listkey |
2103 | Subscriber does not exist |
<response uri="/api/xml/listunsubscribe" version="1">
<code>0</code>
<status>success</status>
<message>User successfully unsubscribed.</message>
</response>
{"message":"User successfully unsubscribed.","status":"success","code":"0","uri":"/api/json/listunsubscribe","version":"1"}
You don’t have to do a research on how effective a list has been or how much reach does a particular list measure. Find out using our API key to find out the number of subscribers in a list.
https://campaigns.zoho.com/api/listsubscriberscount
Request Type: Get
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API key to access account API key to access account (Campaigns API) |
listkey* | String | List API Key to send a subscription mail to contacts |
version | String | This will fetch responses based on the current API version |
resfmt | String | XML (or) JSON |
* - Mandatory Parameter
https://campaigns.zoho.com/api/listsubscriberscount?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&listkey=[ListApiKey]
Our API response will let you know of the following be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
Code - Your error code in the response.
Total List Count - Gives you the count of all the contacts in the list.
We’ve a set of codes that has certain values which 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 key |
2201 | Error in displaying count. Please retry after sometime |
2202 | List key is empty or Invalid |
<response uri="/api/listsubscriberscount" version="1"><code>0</code><status>success</status><no_of_contacts>2</no_of_contacts></response>
{"status":"success","code":"0","uri":"/api/listsubscriberscount","no_of_contacts":2,"version":"1"}
Use our API key to view recent campaigns in this 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
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API Key to access account API key to access account (Campaigns API) |
limit* | Integer | Limit to fetch recent campaigns from campaigns list |
version | String | This will fetch responses based on the current API version |
* - Mandatory Parameter
https://campaigns.zoho.com/api/recentcampaigns?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]
Our API response will let you know of the following, be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
campaign_status - Lets you know the current status of the campaign.
sent_time - Gives you data of when this campaign was last sent.
created_time - Gives you data of when this campaign was created.
campaign_api_key - The API key used to fetch recent campaign details.
campaign_name - The name of the campaign.
Code - Your error code in the response.
We’ve a set of codes that has certain values which 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 |
<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_api_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_api_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_api_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_api_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_api_key">34594177d382061bc947299b74895e93</fl><br/>
<fl val="campaign_status">Draft</fl><br/>
<fl val="created_time">1342501243000</fl><br/>
</campaign><br/>
</recent-campaigns><br/>
</response>
{"status":"success","recent_campaigns":"[{campaign_name=CAMPAIG, campaign_api_key=34594177d382061b99f747d905612a4b, sent_time=1342503703000, campaign_status=Sent, created_time=1342503640000}, {campaign_name=CAMPAIG, campaign_api_key=34594177d382061b56febfd0cb811b03, sent_time=1342503459000, campaign_status=Sent, created_time=1342503425000}, {campaign_name=CAMPAIG, campaign_api_key=34594177d382061b2bf0c3fb3e40110b, sent_time=1342502423000, campaign_status=Sent,created_time=1342502300000}, {campaign_name=CAMPAIG, campaign_api_key=34594177d382061b1f0db88921e34a27, campaign_status=Draft, created_time=1342502300000}, {campaign_name=123, campaign_api_key=34594177d382061bc947299b74895e93, campaign_status=Draft, created_time=1342501243000}]","code":"0","uri":"/api/recentcampaigns","version":"1"}
You might want to reflect campaign data in your website. Use our API key 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 a different status.
https://campaigns.zoho.com/api/recentsentcampaigns
Request Type: Get
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API key to access account API key to access account (Campaigns API) |
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
https://campaigns.zoho.com/api/recentsentcampaigns?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]
Our API response will let you know of the following be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
email_status - Lets you know the current status of the campaign.
last_sent_time - Gives you data of when this campaign was last sent.
campaign_api_key - The API key used to fetch recent campaign details.
email_name - The name of the campaign.
Code - Your error code in the response.
We’ve a set of codes that has certain values which 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 |
6201 | No campaigns are available in this view |
<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_api_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_api_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_api_key">34594177d382061b2bf0c3fb3e40110b</fl><br/>
<fl val="created_time">1342502300000</fl><br/>
</campaign><br/>
</recent-sent-campaigns><br/>
</response>
{"recent_sent_campaigns":"[{sent_time=1342503703000, campaign_name=CAMPAIG, campaign_api_key=34594177d382061b99f747d905612a4b, created_time=1342503640000}, {sent_time=1342503459000, campaign_name=CAMPAIG, campaign_api_key=34594177d382061b56febfd0cb811b03, created_time=1342503425000}, {sent_time=1342502423000, campaign_name=CAMPAIG, campaign_api_key=34594177d382061b2bf0c3fb3e40110b, created_time=1342502300000}]","status":"success","code":"0","uri":"/api/recentsentcampaigns","version":"1"}
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 key and view the campaign report of a particular email campaign.
Request URL:
https://campaigns.zoho.com/api/campaignreports
Request Type: Get
Parameter | Data Type | Description |
Authentication: authtoken* scope* | String String | API key to access account API key to access account (Campaigns API) |
campaignkey* | String | Fetch campaigns reports from campaign list |
version | String | This will fetch responses based on the current API version |
resfmt | String | XML (or) JSON |
* - Mandatory Parameter
https://campaigns.zoho.com/api/campaignreports?authtoken=[AUTHTOKEN]&scope=[CampaignsAPI]&version=1&resfmt=[XML/JSON]&campaignkey=[CampaignApiKey]
Our API response will let you know of the following be it in the XML or JSON format:
Status - Request status, which is either Success or Error.
Code - Your error code in the response.
We’ve a set of codes that has certain values which 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 |
6001 | Error in displaying reports. Please retry after sometime |
6002 | Invalid Campaign key |
<response uri="/api/campaignreports" 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>
{"status":"success","clicks_count":"2","opens_count":"2","campaign_name":"CAMPAIG","code":"0","uri":"/api/campaignreports","optouts_count":"0",
"bounces_count":"0","version":"1","spams_count":"0","forwards_count":"0","emails_sent_count":"2"}
To access API keys:
Please note that for operations related to campaign management, use only the campaign API key.
Please note that for operations related to list management, you are adviced to use both - the campaign API and the list API
Note:
Note:
In any given scenario, be it any kind of API, we advice you to follow what is given in this document. These API keys are sensitive and any kind of typo during request could result in an error case. However, we thought we should let you know of some points to keep in mind:
Having said that please write to us at support@zohocampaigns.com in case you need further assistance.