Create Campaign

You can create a campaign using this API. Using this API, you can set the camapign name, subject line, sender address; choose the intended mailing list.

Scope required

  • ZohoCampaigns.campaign.CREATE

Other alternative scopes

  • ZohoCampaigns.campaign.CREATE-UPDATE (CREATE + UPDATE)
  • ZohoCampaigns.campaign.WRITE (CREATE + UPDATE + DELETE)
  • ZohoCampaigns.campaign.ALL (CREATE + UPDATE + DELETE + READ)

Header:

  • Content-Type: application/x-www-form-urlencoded
  • Header-Authorization: Zoho-oauthtoken <access_token>

Request Type:

  • Post

Request URL

https://campaigns.zoho.com/api/v1.1/createCampaign

List of Parameters:

Parameter

Data Type

Description

resfmt

String

xml (or) json

campaignname*

String

A name to your campaign

from_email*

String

Email address

subject*

String

Subject line

content_url

String

A valid HTML URL for your campaign content

list_details*

JSON(UTF-8 encoded)

{listkey:[segment_ID,...],listkey:...} - encoded value (You can get list key and segment ID from getmailinglists API)

Possible error cases

Error code Description
500An internal error occured while processing your request.
1001"resfmt" pattern does not match.
1004Invalid URL for content import.
3001Campaign content cannot exceed 300000 characters.
6606No lists selected for this campaign.

If your error code is not listed above, click here.

Sample XML Request


				https://campaigns.zoho.com/api/v1.1/createCampaign?resfmt=xml&campaignname=newsletter&from_email=patricia@zoho.com&subject=festive offer&list_details=%7B34594177d382061b27dd314490758f5d%3A%5B4000000023018 %5D%2C34594177d382061b939770a6d682df24%3A%5B%5D%7D%0A			

Sample Response


				<response>
	<message>Campaign created successfully</message>
	<campaignKey>10234695</campaignKey>
	<code>200</code>
	<uri>/api/v1.1/createCampaign</uri>
</response>			

Sample JSON Request


				https://campaigns.zoho.com/api/v1.1/createCampaign?resfmt=json&campaignname=newsletter&from_email=patricia@zoho.com&subject=festive offers& list_details=%7B34594177d382061b27dd314490758f5d%3A%5B4000000023018 %5D%2C34594177d382061b939770a6d682df24%3A%5B%5D%7D%0A			

Sample Response


				{
  "message": "Campaign created successfully",
  "campaignKey": "10234695",
  "code": "200",
  "uri": "/api/v1.1/createCampaign"
}