ResourcesAPI documentation

mailkit.campaigns.history

Function mailkit.campaigns.history returns a history of all messages or campaign deliveries.

API call example:

XML-RPC

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
  <methodName>mailkit.campaigns.history</methodName>
  <params>
    <param>
      <value>
        <int>client_id</int>
      </value>
    </param>
    <param>
      <value>
        <string>client_md5</string>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>list_count</name>
            <value>
              <i4>30</i4>
            </value>
          </member>
          <member>
            <name>campaign_id</name>
            <value>
              <string></string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

JSON

{  
   "id":"client_id",
   "md5":"client_md5",
   "function":"mailkit.campaigns.history",
   "parameters":{  
      "list_count":5,
      "campaign_id":campaign_id
   }
}

Construct

{
   'id' => $cid,
   'md5' => $md5,
   'function' => 'mailkit.campaigns.history',
   'parameters' =>{
      'list_count' => $limit,
      'campaign_id' => $ID_message
   }
}

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.
campaign_id = Campaign ID (as returned by mailkit.campaigns.create). If no ID is provided a list of all messages sent will be returned sorted by date descending and limited by number defined in list_count.
list_count = number of records (min. 1, max 50, default 10).

* required value

Succesfull call response:

XML-RPC

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>ID_MESSAGE</name>
                  <value>
                    <i4>123456789</i4>
                  </value>
                </member>
                <member>
                  <name>ID_SEND</name>
                  <value>
                    <i4>123456789</i4>
                  </value>
                </member>
                <member>
                  <name>DATE</name>
                  <value>
                    <string>2016-03-16 13:40:54</string>
                  </value>
                </member>
                <member>
                  <name>PREVIEW</name>
                  <value>
                    <string>https://u.mailkit.eu/XXXX</string>
                  </value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

JSON

[  
   {  
      "ID_MESSAGE":"123456",
      "ID_SEND": "123456",
      "DATE":"2016-03-14 09:23:56",
      "PREVIEW":"https://u.mailkit.eu/XXXX"
   }
]

Values:

ID_MESSAGE = Campaign ID
ID_SEND = Campaign delivery ID
DATE = date sent
PREVIEW = campaign preview URL

Unsuccesfull call response

XML-RPC

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>data</name>
            <value>
              <string>Invalid campaign_id</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

JSON

{  
   "error_status":1,
   "error":"Invalid list_count"
}

Values:

Invalid campaign_id = invalid campaign ID
Invalid list_count = invalid list count limit (min 1, max 50, default 10)