Developer Network

API Reference: Campaign.SpamTest

Tests provided raw email content through SpamAssassin spam-filter and returns the raw output.

Input Parameters

Following parameters are required by this command:

  • APIKey
    Your user account API key. You can learn your API key in your Sendloop area > Manage Account section
  • Command
    For subscribing an email address, you should set this parameter to 'Campaign.SpamTest'
  • RawEmail Raw email content (with headers and body parts)

Output

Sendloop will return some information about the spam test. Sendloop always return in XML-RPC format. Below, you can see the list of all available codes and messages which can be returned by this command:

Error Codes and Messages:

One of the following error messages will be returned if any error occurs:

  • #1
    Connection type is not compatible
  • #2
    Invalid API key or user account is not available

Success Message

Success message will include the following three parameters:

  • Status
    'Completed' will be returned
  • Return
    Base64 encoded raw spam test results will be returned.

Examples

We provided examples in all three accepted messaging formats. Bold texts means data that needs to be replaced by you.

HTTP-POST Example

Input:

POST /api/index.php HTTP/1.1
Host: yoursubdomain.sendloop.com
Content-Type: application/x-www-form-urlencoded

FormValue_APIKey=YourAPIKeyHere&FormValue_Command=Campaign.SpamTest&
FormValue_RawEmail=Your raw email content here (with headers and body parts)

HTTP-GET Example

Even this command accepts HTTP-GET method, we strongly recommend you to use HTTP-POST or XML-RPC methods

GET /api/index.php?APIKey=YourAPIKeyHere&Command=Campaign.SpamTest&RawEmail=
Your raw email content here (with headers and body parts)
HTTP/1.1 Host: yoursubdomain.sendloop.com

XML-RPC Example

To connect Sendloop API through XML-RPC messaging format, you will need to pass XML-RPC code via HTTP-POST or HTTP-GET method:

XML-RPC connection via HTTP-POST:

POST /api/index.php HTTP/1.1
Host: yoursubdomain.sendloop.com
Content-Type: application/x-www-form-urlencoded

FormValue_Message=<<<The following XML structure must be inserted here with URL
encoded structure>>> <Entry>  <Message>   <APIKey>YourAPIKeyHere</APIKey>   <Command>Subscriber.Add</Command>   <RawEmail>Your raw email content here (with headers and body parts)</RawEmail>  </Message> </Entry>

XML-RPC connection via HTTP-GET:

GET /api/index.php?FormValue_Message=<<<The following XML structure must be
inserted here with URL encoded structure>>> HTTP/1.1 Host: yoursubdomain.sendloop.com <Entry>  <Message>   <APIKey>YourAPIKeyHere</APIKey>   <Command>Subscriber.Add</Command>   <RawEmail>Your raw email content here (with headers and body parts)</RawEmail>  </Message> </Entry>

Error Output Example

<value>
 <struct>
  <member>
   <name>APIError</name>
   <value><string>Invalid API key or user account
     is not available</string></value>
  </member>
  <member>
   <name>APIErrorCode</name>
   <value><string>2</string></value>
  </member>
 </struct>
</value>

Success Output Example

<value>
 <struct>
  <member>
   <name>Status</name>
   <value><string>Completed</string></value>
  </member>
  <member>
   <name>Return</name>
   <value><string>Base64 encoded raw spam test results</string></value>
  </member>
 </struct>
</value>

API Reference

Campaign Functions

Subscriber List Functions

Subscriber Custom Field Functions

Subscriber List Segment Functions

Subscriber List Integration Functions

Subscriber Functions

Report Functions

Media Library Functions

Chart Functions