ResourcesAPI documentation

mailkit.campaigns.update

Function mailkit.campaigns.update is used to update or alter an existing campaign.

XML-RPC request must be sent in the format displayed below. 

NOTICE: Data must be Base64 encoded.

API call example:

XML

<?xml version="1.0"?>
<methodCall>
 <methodName>mailkit.campaigns.update</methodName>
 <params>
  <param>
   <value>
    <int>client_id</int>
   </value>
  </param>
  <param>
   <value>
    <string>client_md5</string>
   </value>
  </param>
  <param>
   <value>
    <string>ID_message</string>
   </value>
  </param>
  <param>
   <value>
    <string>update (true/false)</string>
   </value>
  </param>
  <param>
   <value>
    <struct>
     <member>
      <name>name</name>
      <value>
       <string>campaign name</string>
      </value>
     </member>
     <member>
      <name>subject</name>
      <value>
       <string>subject</string>
      </value>
     </member>
     <member>
      <name>ID_allow_email</name>
      <value>
       <string>ID of sender email address</string>
      </value>
     </member>
     <member>
      <name>ID_mailing_list</name>
      <value>
       <string>ID of mailing list</string>
      </value>
     </member>
     <member>
      <name>ID_delivery_feed</name>
      <value>
       <string>ID of delivery feed datasource</string>
      </value>
     </member>
     <member>
      <name>ID_query</name>
      <value>
       <string>ID of query</string>
      </value>
     </member>
     <member>
      <name>ID_template</name>
      <value>
       <string>ID of template</string>
      </value>
     </member>
     <member>
      <name>google_analytics</name>
      <value>
       <string>true|false</string>
      </value>
     </member>
     <member>
      <name>analytic_name</name>
      <value>
       <string>name for analytics</string>
      </value>
     </member>
     <member>
      <name>ID_tagset</name>
      <value>
       <string>ID of tagset</string>
      </value>
     </member>
     <member>
      <name>test_mode</name>
      <value>
       <string>true|false</string>
      </value>
     </member>
     <member>
      <name>test_emails</name>
      <value>
       <string>comma separated email list</string>
      </value>
     </member>
     <member>
      <name>content</name>
      <value>
       <string>content 1</string>
      </value>
     </member>
     <member>
      <name>content2</name>
      <value>
       <string>content 2</string>
      </value>
     </member>
     <member>
      <name>reply_to</name>
      <value>
       <string>email@domain.com</string>
      </value>
     </member>
     <member>
      <name>unsubscribe_email</name>
      <value>
       <string>email@domain.com</string>
      </value>
     </member>
     <member>
      <name>web_template</name>
      <value>
       <string>true|false</string>
      </value>
     </member>
     <member>
      <name>style_inline</name>
      <value>
       <string>true|false</string>
      </value>
     </member>
     <member>
      <name>ID_unsubscribe_group</name>
      <value>
       <string>ID of topic</string>
      </value>
     </member>
    </struct>
   </value>
  </param>
  ---AB test settings, campaign B version---
  <param>
   <value>
    <struct>
     <member>
      <name>subject</name>
      <value>
       <string>subject B version</string>
      </value>
     </member>
     <member>
      <name>content</name>
      <value>
       <string>content 1 B</string>
      </value>
     </member>
     <member>
      <name>content2</name>
      <value>
       <string>content 2 B</string>
      </value>
     </member>
     <member>
      <name>ID_allow_email</name>
      <value>
       <string>ID of sender email address</string>
      </value>
     </member>
     <member>
      <name>ab_percentage</name>
      <value>
       <string>1-99</string>
      </value>
     </member>
     <member>
      <name>ab_evalution</name>
      <value>
       <string>open|click|conversion|ctr</string>
      </value>
     </member>
     <member>
      <name>ab_evalution_time</name>
      <value>
       <string>1h-4d</string>
      </value>
     </member>
    </struct>
   </value>
  </param>
  ------
</params>
</methodCall>

JSON

{
	"function": "mailkit.campaigns.update",
	"id": "cleint_id",
	"md5": "client_md5",
	"ID_message":"ID of message",
	"update":"true|false",
	"parameters": {
		"name": "campaign name",
		"subject": "subject",
		"ID_allow_email": "ID of sender email address",
		"ID_mailing_list":"ID of mailing list",
		"ID_delivery_feed":"ID of delivery feed datasource",
		"ID_query":"ID of query",
		"ID_template":"ID of template",
		"google_analytics":"true|false",
		"analytic_name":"name for analytics",
		"ID_tagset":"ID of tagset",
		"test_mode":"true|false",
		"test_emails":"comma separated list of emails",
		"content":"content 1",
		"content2":"content 2",
		"content3":"content 3",
		"content4":"content 4",
		"content5":"content 5",
		"content6":"content 6",
		"content7":"content 7",
		"content8":"content 8",
		"content9":"content 9",
		"content10":"content 10",
		"reply_to":"email@domain.com",
		"unsubscribe_email":"email@domain.com",
		"web_template":"true|false",
		"style_inline":"true|false",
		"ID_unsubscribe_group":"ID of topic"
	},
	"ab_version":{
		"subject":"subject B version",
		"content":"content 1 B",
		"content2":"content 2 B",
		"ID_allow_email":"ID of sender email address",
		"ID_template":"ID of template",
		"ab_percentage":"1-99",
		"ab_evaluation":"open|click|conversion|ctr",
		"ab_evaluation_time":"1h-4d"
	}
}

Values

client_id * = client ID can be found in your Mailkit account's menu Profile / Integration / API settings.
client_md5 * = MD5 code can be found in your Mailkit account's menu Profile / Integration / API settings.
ID_message * = ID of campaign
update * = update settings

  • true = empty parameters will be set to default
  • false = empty parameters will not change

name (Base64) = name of campaign
subject (Base64) = subject of campaign
ID_allow_email (Base64) * = ID of sender address
ID_mailing_list (Base64) = ID of mailing list / lists. (ID of mailing lists are comma separated)
ID_delivery_feed = ID of the data source (delivery feed). Campaign can use either mailing lists or a single delivery feed.
ID_template (Base64) = ID of template
ID_query (Base64) = ID of a query (only in combination with mailing list)
test_mode (Base64) = enable campaign test mode

  • true = enabled
  • false = disable

test_emails (Base64) = comma/semicolon separated list of email addresses for test mode (max. 10 addresses) 
google_analytics (base64) = automatic link utm tagging for Google Analytics

  • true = enabled​​
  • false = disabled

analytics_name (base64) = campaign name for Google Analytics reporting
ID_tagset (Base64) = ID of tagset for link tracking
content (Base64) = content 1
content2 (Base64) = content 2. Total number of contents is 10.
reply_to (Base64) = e-mail address for reply-to
unsubscribe_email (Base64) = e-mail address for sending unsubscribes
web_template (Base64) = use microsite:

  • true = yes
  • false = no

style_inline (Base64) = convert CSS styles to inline:

  • true = yes
  • false = no

ID_unsubscribe_group (Base64) = ID of unsubscribes group
ab_percentage (Base64) = AB test group size as percentage (1 - 99)
ab_evalution (Base64) = AB test evaluation criteria (open|click|conversion|ctr)
ab_evalution_time (Base64) = AB test evaluation time (1h - 23h, 1d - 4d)

* required value

Successful call response:

XML

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>123456789</i4>
      </value>
    </param>
  </params>
</methodResponse>

JSON

{
    "message": "Campaign 123456789 updated",
    "error_status": 0,
    "ID_message": "123456789"
}

Values

ID of updated campaign

Unsuccessful call response:

XML

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>Missing allow email</string>
      </value>
    </param>
  </params>
</methodResponse>

JSON

{
    "error": "Missing name of campaign",
    "error_status": 1,
    "error_code": 1
}

Values

Missing name of campaign (error_code:1) = campaign name is missing
Missing subject of campaign (error_code:2/52 for B ver) = campaign subject is missing
Missing ID allow email (error_code:3/53 for B ver) = ID_allow_email is missing

error allow email: ID, status, auth (error_code:4/54 for B ver) = ID_allow_email selected can not be used (sending address is not properly configured
Wrong ID_template (error_code:5/55 for B ver) = ID_template provided is not valid
Invalid ID_query (error_code:6) = Requested query ID was not found
Wrong ID_query (error_code: 7) =Requested query can not be used
Invalid ID_delivery_feed (error_code: 8) = Requested delivery feed ID doesn't exist or is not a delivery feed data source.
No valid emails provided in test_emails param (error_code: 9) = Empty or invalid list of emails provided
Invalid tagset ID (error_code: 10) = Requested tagset doesn't exist
Wrong ID_mailing_list (error_code: 11) = Invalid mailing list ID requested
Confused parameters - it is not possible to combine mailing lists and delivery feeds (error_code: 12) = Request contains both mailing list ID and delivery feed ID which is an invalid combination.
Confused parameters - it is not possible to combine delivery capping and delivery feeds (error_code: 13) = Request contains both delivery feed ID and delivery capping query ID which is an invalid combination.
Content failed to save (error_code: 14) = An error occurred while saving message content.
Missing ID_message (error_code:15) = ID of message is missing in the request
Wrong ID_message (error_code: 16) = An invalid ID of message has been requested
Missing ab percentage (error_code: 82) = AB test group size percentage value is missing
Wrong ab percentage (error_code: 83) = Invalid AB test group size percentage
Wrong ab evalution (error_code: 81) = Invalid AB test evaluation policy requested
Wrong ab evalution time (error_code: 81) = Invalid AB test evaluation time duration requested