Mandatory parameters -
authtoken*
scope*
listkey*
To successfully access list data through the APIs, knowing the list key of the respective list is mandatory.
Response Formats
Note
Users can subscribe to a list without using the signup form nor by getting added by a contact. They can subscribe using our API Authentication Token and the user added will be notified.
You've an option of using either the XML (or) JSON format at the time of request.
XML: https://campaigns.zoho.com/api/xml/listsubscribe
JSON: https://campaigns.zoho.com/api/json/listsubscribe
Request Type: Post
Parameters:
| Parameter | Data Type | Description |
| authtoken* | String | API Authentication Token |
| listkey* | String | List 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
Sample Request:
https://campaigns.zoho.com/api/xml/listsubscribe?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&listkey=[listkey]&contactinfo=<xml><fl val="First Name">mac</fl><fl val="Contact Email">jai@zoho.com</fl></xml>
https://campaigns.zoho.com/api/json/listsubscribe?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&listkey=[listkey]&contactinfo={First Name:mac,Last Name:Last Name,Contact Email:jai@zoho.com}
Sample Response:
Our API response will let you know of the following be it in the XML or JSON format.
<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"}
Disinterested subscribers in your list? Never mind, all you need to do is enter the API Authentication Token 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
Parameters:
| Parameter | Data Type | Description |
| authtoken* | String | API Authentication Tokent |
| listkey* | String | List 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
Sample Request:
https://campaigns.zoho.com/api/xml/listunsubscribe?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&listkey=[listkey]&contactinfo=<xml><fl val="First Name">mac</fl><fl val="Contact Email">jai@zoho.com</fl></xml>
https://campaigns.zoho.com/api/json/listunsubscribe?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&listkey=[listkey]&contactinfo={First Name:mac,Last Name:Last Name,Contact Email:jai@zoho.com}
Sample Response:
Our API response will let you know of the following be it in the XML or JSON format:
<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 research on how effective a list has been or how much reach does a particular list measure. Find out using our API Authentication Token to find out the number of subscribers in a list.
https://campaigns.zoho.com/api/listsubscriberscountRequest Type: Get
Parameters:
| Parameter | Data Type | Description |
| authtoken* | String | API Authentication Token |
| listkey* | String | List 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
Sample Request:
https://campaigns.zoho.com/api/listsubscriberscount?authtoken=[API Authentication Token]&scope=CampaignsAPI&version=1&resfmt=[XML/JSON]&listkey=[listkey]
Sample Response:
Our API response will let you know of the following be it in the XML or JSON format:
<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"}
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 |
| 2101 | Error in unsubscription. Please retry after sometime |
| 2102 | Listkey is empty or Invalid Listkey |
| 2103 | Subscriber does not exist |
| 2201 | Error in displaying count. Please retry after sometime |
| 2202 | List key is empty or Invalid |