Anthill API Documentation

Posted by Jacob Goodwin in Integrations - Last updated

Welcome to the Anthill guide on how to integrate with Anthill.

The Anthill SOAP API allows access to create, view and modify records stored within your Anthill installation.

Every Anthill customer has dedicated API access.

https://[YOUR_INSTALLATION].anthillcrm.com/api/v1.asmx?wsdl

For further support or to request your API access, please contact support@anthill.co.uk.

Security

All requests must be by HTTPS to ensure a secure connection and have TLS v1.2 enabled.

Each API request must include an AuthHeader element which includes the API Username and Key in the Username and Password fields respectively.

Concepts

To use the Anthill API it is best to understand the building blocks that form the Anthill platform.

The following functions are detailed in full within this post. To navigate, click the links below to jump to your relevant section:


Get Functions

Here we cover all of the available Get Functions associated with the Anthill API. This includes:

Get Locations

This method returns a list of the locations that are active within your installation.

Locations can be used to group customer activity into regions, areas and stores.

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <GetLocations xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Response: 

<?xml version="1.0" encoding="utf-8"?>

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

  <soap12:Body>

    <GetLocationsResponse xmlns="http://www.anthill.co.uk/">

      <GetLocationsResult>

        <Location>

          <LocationId>int</LocationId>

          <Label>string</Label>

          <Hierarchy>string</Hierarchy>

          <Description>string</Description>

          <Telephone>string</Telephone>

          <Email>string</Email>

          <Longitude>string</Longitude>

          <Latitude>string</Latitude>

        </Location>

        <Location>

          <LocationId>int</LocationId>

          <Label>string</Label>

          <Hierarchy>string</Hierarchy>

          <Description>string</Description>

          <Telephone>string</Telephone>

          <Email>string</Email>

          <Longitude>string</Longitude>

          <Latitude>string</Latitude>

        </Location>

      </GetLocationsResult>

    </GetLocationsResponse>

  </soap12:Body>

</soap12:Envelope>

Get Location Details

This method returns the custom fields contents for a specific Location ID.

Request:
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <GetLocationDetails xmlns="http://www.anthill.co.uk/">
      <locationId>int</locationId>
    </GetLocationDetails>
  </soap12:Body>
</soap12:Envelope>
Response :

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetLocationDetailsResponse xmlns="http://www.anthill.co.uk/">
      <GetLocationDetailsResult>
        <ID>int</ID>
        <Name>string</Name>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
      </GetLocationDetailsResult>
    </GetLocationDetailsResponse>
  </soap12:Body>
</soap12:Envelope>

Get Customer Details

This method returns the custom field contents for a customer record based on the Customer ID passed. Use this to access customer data.

If the includeActivity Boolean flag is set to TRUE then a snap shot of the customer activity is also included. Use this to access leads and sale records for a given customer record.

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <GetCustomerDetails xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <includeActivity>boolean</includeActivity>
    </GetCustomerDetails>
  </soap:Body>
</soap:Envelope> 
Response :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetCustomerDetailsResponse xmlns="http://www.anthill.co.uk/">
      <GetCustomerDetailsResult>
        <CustomerId>int</CustomerId>
        <Location>
          <LocationId>int</LocationId>
          <Label>string</Label>
        </Location>
        <Name>string</Name>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
        <RecentActivity>
          <RecentActivityModel>
            <Category>int</Category>
            <Id>int</Id>
            <Type>string</Type>
            <Created>dateTime</Created>
            <Status>string</Status>
          </RecentActivityModel>
          <RecentActivityModel>
            <Category>int</Category>
            <Id>int</Id>
            <Type>string</Type>
            <Created>dateTime</Created>
            <Status>string</Status>
          </RecentActivityModel>
        </RecentActivity>
        <Address>
          <Address1>string</Address1>
          <Address2>string</Address2>
          <City>string</City>
          <County>string</County>
          <Country>string</Country>
          <Postcode>string</Postcode>
        </Address>
      </GetCustomerDetailsResult>
    </GetCustomerDetailsResponse>
  </soap:Body>
</soap:Envelope>

Get Contact

This method returns the custom field contents for a contact record based on the Contact ID passed. Use this to access contact level data.

Contacts are usually used for B2B configurations to store multiple people against a customer account.

Request:
 <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <GetContact xmlns="http://www.anthill.co.uk/">
      <contactId>int</contactId>
    </GetContact>
  </soap:Body>
</soap:Envelope> 
Response :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetContactResponse xmlns="http://www.anthill.co.uk/">
      <GetContactResult>
        <Title>string</Title>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <Email>string</Email>
        <Telephone>string</Telephone>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
        <IsPrimaryContact>boolean</IsPrimaryContact>
        <CustomerID>int</CustomerID>
      </GetContactResult>
    </GetContactResponse>
  </soap:Body>
</soap:Envelope>

Get [Activities] Modified Since

This collection of methods each returns a list of activities that have been updated since the passed data and time field. This can be used to poll for changes to records for integration purposes.

Results are limited to 100 records and are returned in ascending date order. When there are more than 100 records that have been modified since the supplied date, re-issue your API call with the ‘since’ parameter set to the date/time of the last record in the previous call.

Actual Method Names: GetEnquiriesModifiedSince, GetLeadsModifiedSince, GetSalesModifiedSince, GetFulfilmentsModifiedSince, GetIssuesModifiedSince.

Request:
 <?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <GetSalesModifiedSince xmlns="http://www.anthill.co.uk/">
      <typeId>int</typeId>
      <since>dateTime</since>
    </GetSalesModifiedSince>
  </soap12:Body>
</soap12:Envelope> 
Response :

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetSalesModifiedSinceResponse xmlns="http://www.anthill.co.uk/">
      <GetSalesModifiedSinceResult>xml</GetSalesModifiedSinceResult>
    </GetSalesModifiedSinceResponse>
  </soap12:Body>
</soap12:Envelope>

Get [Activities] By External Reference

This returns the contents of a customer activity found by an external reference number. Anthill does not guarantee the uniqueness of an external reference so this method may return multiple results.

Actual Method Names: GetEnquiriesByExternalReference, GetLeadsByExternalReference, GetSalesByExternalReference, GetFulfilmentsByExternalReference, GetIssuesByExternalReference.

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <GetFulfilmentsByExternalReference xmlns="http://www.anthill.co.uk/">
      <externalReference>string</externalReference>
    </GetFulfilmentsByExternalReference>
  </soap12:Body>
</soap12:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetFulfilmentsByExternalReferenceResponse xmlns="http://www.anthill.co.uk/">
      <GetFulfilmentsByExternalReferenceResult>
        <FulfilmentInfo>
          <FulfilmentId>int</FulfilmentId>
          <ExternalReference>string</ExternalReference>
          <FulfilmentType>string</FulfilmentType>
          <CreatedDate>dateTime</CreatedDate>
          <Status>string</Status>
        </FulfilmentInfo>
        <FulfilmentInfo>
          <FulfilmentId>int</FulfilmentId>
          <ExternalReference>string</ExternalReference>
          <FulfilmentType>string</FulfilmentType>
          <CreatedDate>dateTime</CreatedDate>
          <Status>string</Status>
        </FulfilmentInfo>
      </GetFulfilmentsByExternalReferenceResult>
    </GetFulfilmentsByExternalReferenceResponse>
  </soap12:Body>
</soap12:Envelope>

Get Attachment

This method returns an attachment as a base64 encoded string when passed a GUID for a particular attachment within the system.

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <GetAttachment xmlns="http://www.anthill.co.uk/">
      <fileGuid>string</fileGuid>
    </GetAttachment>
  </soap12:Body>

Get [Activities] Types

These methods return the various types for each activity.

Actual Method Names: GetEnquiryTypes, GetLeadTypes, GetSaleTypes, GetIssueTypes

Request:
Request:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Header>

    <AuthHeader xmlns="http://www.anthill.co.uk/">

      <Username>string</Username>

      <Password>string</Password>

    </AuthHeader>

  </soap:Header>

  <soap:Body>

    <GetEnquiryTypes xmlns="http://www.anthill.co.uk/" />

  </soap:Body>

</soap:Envelope>

Response:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>

<GetActivityTypesResponse xmlns="http://www.anthill.co.uk/">

      <GetActivityTypesResult>

        <Types>
          <Type id="int" name="string">
            <Controls>
               <detail type="dropdownlist text reference lookup" label="string">
      <choice value="string">string</choice>
      <choice value="string">string</choice>
      <choice value="string">string</choice>
               </detail>
            </Controls>
          </Type>
        </Types></GetActivityTypesResult>

</GetActivityTypesResponse>
  </soap:Body>
</soap:Envelope>

GetCustomerTypes / GetContactTypes / GetAttachmentTypes

These methods return the custom fields for the Customer/ Contact/ Attachment types.

Customers can have a number of types of fields, mainly though text and dropdownlists. Reference and Lookup fields will store a text value that has been selected from a list.

Request:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Header>

    <AuthHeader xmlns="http://www.anthill.co.uk/">

      <Username>string</Username>

      <Password>string</Password>

    </AuthHeader>

  </soap:Header>

  <soap:Body>

    <GetCustomerTypes xmlns="http://www.anthill.co.uk/" />

Or
    <GetAttachmentTypes xmlns="http://www.anthill.co.uk/" />
Or
    <GetContactTypes xmlns="http://www.anthill.co.uk/" />

</soap:Body>

</soap:Envelope>

CustomerTypes Response

Response :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetCustomerTypesResponse xmlns="http://www.anthill.co.uk/">
      <GetCustomerTypesResult>
             <Types>
               <Type id="int" name="Customer">
                  <Controls>
                    <detail type="dropdownlist" label="string">
                       <choice value="string">string</choice>
                    </detail>
                    <detail type="text reference lookup" label="string"/>
                  </Controls>
               </Type>
             </Types>
      </GetCustomerTypesResult>
    </GetCustomerTypesResponse>
  </soap:Body>
</soap:Envelope>

AttachmentTypes Response

 

Response :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
        <GetAttachmentTypesResponse xmlns="http://www.anthill.co.uk/">
        <GetAttachmentTypesResult>
                <Types>
                 <Type id="int" name="string"/>
                 <Type id="int" name="string"/>
                 <Type id="int" name="string"/>
               </Types>
        </GetAttachmentTypesResult>
        </GetAttachmentTypesResponse>
  </soap:Body>
</soap:Envelope>

ContactTypes Response

Response :

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetContactTypesResponse xmlns="http://www.anthill.co.uk/">
      <GetContactTypesResult>
              <Types>
               <Type id="int" name="string">
                 <Controls>
                  <detail type="dropdownlist" label="string">
                    <choice value="string">string</choice>
                    </detail>
                    <detail type="text reference lookup" label="string"/>
                 </Controls>
              </Type>
        </Types>
</GetContactTypesResult>
    </GetContactTypesResponse>
  </soap:Body>
</soap:Envelope>


Create Functions

Most of the create functions take an array of CustomFields. A CustomField is a key-value pair of strings.

Anthill will store any fields supplied where the key matches (case-sensitive) a configured field name. Any fields where the key cannot be found will not be saved.

Anthill also validates the CustomField against the configured requirements. If one or more fields fails validation the entire request returns an exception with the details about which field did not validate.

Here we cover all of the available Create Functions associated with the Anthill API. This includes:

Create Customer

This request will create a new customer record.

Please check the configuration in your Anthill installations for details of the following required parameters:

locationId = the Location Id that the customer should be created against.

source = can be used for tracking marketing activity

customer > TypeId = specifies the type of customer being are creating

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <CreateCustomer xmlns="http://www.anthill.co.uk/">
      <locationId>int</locationId>
      <source>string</source>
      <customer>
        <TypeId>int</TypeId>
        <MarketingConsentGiven>boolean</MarketingConsentGiven>
        <Address>
          <Address1>string</Address1>
          <Address2>string</Address2>
          <City>string</City>
          <County>string</County>
          <Country>string</Country>
          <Postcode>string</Postcode>
        </Address>
        <ExternalReference>string</ExternalReference>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
      </customer>
    </CreateCustomer>
  </soap12:Body>
</soap12:Envelope>

The response will contain the unique Customer ID for the created customer or an existing customer if a match has been found based on the dedupe settings in Anthill.

Response :

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CreateCustomerResponse xmlns="http://www.anthill.co.uk/">
      <CreateCustomerResult>int</CreateCustomerResult>
    </CreateCustomerResponse>
  </soap12:Body>
</soap12:Envelope>

Create Customer [Activity]

This function creates a customer AND an activity in the same post. This is commonly used for creating new website enquiries, leads or sales.

Please check the configuration in your Anthill installations for details of the following required parameters:

locationId = the Location Id that the customer should be created against.

source = can be used for tracking marketing activity

customer > TypeId = specifies the type of customer being created

enquiry > TypeId = specifies the type of activity being created

On creating a new activity, the associated workflow will automatically be created.

Actual Method Names: CreateCustomerEnquiry, CreateCustomerLead, CreateCustomerSale

Request:
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <CreateCustomerEnquiry xmlns="http://www.anthill.co.uk/">
      <locationId>int</locationId>
      <source>string</source>
      <customer>
        <TypeId>int</TypeId>
        <MarketingConsentGiven>boolean</MarketingConsentGiven>
        <Address>
          <Address1>string</Address1>
          <Address2>string</Address2>
          <City>string</City>
          <County>string</County>
          <Country>string</Country>
          <Postcode>string</Postcode>
        </Address>
        <ExternalReference>string</ExternalReference>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
      </customer>
      <enquiry>
        <TypeId>int</TypeId>
        <ExternalReference>string</ExternalReference>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
        <Tags>
          <string>string</string>
          <string>string</string>
        </Tags>
      </enquiry>
    </CreateCustomerEnquiry>
  </soap12:Body>
</soap12:Envelope>

The response will contain the unique Customer ID for the created customer or an existing customer if a match has been found based on the dedupe settings in Anthill and the unique ID for the created activity.

Response :

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CreateCustomerEnquiryResponse xmlns="http://www.anthill.co.uk/">
      <CreateCustomerEnquiryResult>
        <int>int</int>
        <int>int</int>
      </CreateCustomerEnquiryResult>
    </CreateCustomerEnquiryResponse>
  </soap12:Body>
</soap12:Envelope>

Create [Activity]

This function is used when the customer record already exists in Anthill and the requirement is to only create a new activity. 

Actual Method Names: CreateCustomerEnquiry, CreateCustomerLead, CreateCustomerSale

Please check the configuration in your Anthill installations for details of the following required parameters:

locationId = the Location Id that the customer should be created against.

source = can be used for tracking marketing activity

customer > TypeId = specifies the type of customer being created

enquiry > TypeId = specifies the type of activity being created

On creating a new activity, the associated workflow will automatically be created.

Actual Method Names: CreateEnquiry, CreateLead, CreateSale, CreateIssue

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <CreateIssue xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <locationId>int</locationId>
      <source>string</source>
      <issue>
        <TypeId>int</TypeId>
        <ExternalReference>string</ExternalReference>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
      </issue>
    </CreateIssue>
  </soap12:Body>
</soap12:Envelope>
Response :

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CreateIssueResponse xmlns="http://www.anthill.co.uk/">
      <CreateIssueResult>int</CreateIssueResult>
    </CreateIssueResponse>
  </soap12:Body>
</soap12:Envelope>


Add Functions

Here we cover all of the available Add Functions associated with the Anthill API. This includes:

Add Customer Contact

This function allows you to add a customer contact to an existing customer record.

customerId = the existing customer record stored in Anthill

TypeId = the type of contact to be added

Request

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <AddCustomerContact xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <contactModel>
        <TypeId>int</TypeId>
        <IsPrimaryContact>boolean</IsPrimaryContact>
        <Title>string</Title>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <Telephone>string</Telephone>
        <Email>string</Email>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
      </contactModel>
    </AddCustomerContact>
  </soap:Body>
</soap:Envelope>

The response will return a unique ID for the newly created contact.

Response:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <AddCustomerContactResponse xmlns="http://www.anthill.co.uk/">
      <AddCustomerContactResult>int</AddCustomerContactResult>
    </AddCustomerContactResponse>
  </soap:Body>
</soap:Envelope>

Add [Activity] Attachment

This function is used to add files as attachments to customer activity within Anthill.

Actual Method Names: AddEnquiryAttachment, AddLeadAttachment, AddSaleAttachment, AddFulfilmentAttachment, AddIssueAttachment,

leadId = the unique Lead ID of the lead that the attachment is to be created against.

attachmentTypeId = the type of attachment that is to be created

filename = name of the file that you are submitted

base64EncodedAttachment = the file contents encoded as a base64 string

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <AddLeadAttachment xmlns="http://www.anthill.co.uk/">
      <leadId>int</leadId>
      <attachmentTypeId>int</attachmentTypeId>
      <filename>string</filename>
      <base64EncodedAttachment>string</base64EncodedAttachment>
    </AddLeadAttachment>
  </soap12:Body>
</soap12:Envelope>

Add [Activity] Update

This function is used to add a note update to an existing customer activity. All updates added are viewable in Anthill on the customer history. 

Actual Method Names: AddEnquiryUpdate, AddLeadUpdate, AddSaleUpdate, AddFulfilmentUpdate, AddIssueUpdate,

[Activity]Id = the unique Id for the existing activity in Anthill

Title = A title for the note, max length = 35 characters

Notes = the contents of the note, max length = 4000characters

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <AddEnquiryUpdate xmlns="http://www.anthill.co.uk/">
      <enquiryId>int</enquiryId>
      <title>string</title>
      <notes>string</notes>
      <newStatus>NoChange or Complete or Cancelled</newStatus>
    </AddEnquiryUpdate>
  </soap12:Body>
</soap12:Envelope>
Response:


<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <AddEnquiryUpdateResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Add Payment

This function is used to record a payment against an existing customer sale.

orderId = the unique ID for the existing customer sale in Anthill

paymentTypeId = the ID for the type of payment to be added

Please note the values of the payment are passed via the custom fields collection. Please see your installation configuration for more details.

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <AddPayment xmlns="http://www.anthill.co.uk/">
      <orderId>int</orderId>
      <paymentTypeId>int</paymentTypeId>
      <customFields>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
      </customFields>
    </AddPayment>
  </soap12:Body>
</soap12:Envelope>


Edit Functions

Here we cover all of the available Edit Functions associated with the Anthill API. This includes:

Edit Customer Address

This function allows an existing customer address to be edited.

customerId = the unique ID for the existing customer record stored in Anthill

addressModel = containsthe fixed values that can be changed via this function.

Request: 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <EditCustomerAddress xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <addressModel>
        <Address1>string</Address1>
        <Address2>string</Address2>
        <City>string</City>
        <County>string</County>
        <Country>string</Country>
        <Postcode>string</Postcode>
      </addressModel>
    </EditCustomerAddress>
  </soap12:Body>
</soap12:Envelope>
Response: 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <EditCustomerAddressResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Edit Customer Contact

This function allows an existing customer contact to be edited.

contactId = the unique ID for the existing customer contact record stored in Anthill

Request:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <EditCustomerContact xmlns="http://www.anthill.co.uk/">
      <contactId>int</contactId>
      <contactModel>
        <Title>string</Title>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <Email>string</Email>
        <Telephone>string</Telephone>
        <CustomFields>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
          <CustomField>
            <Key>string</Key>
            <Value>string</Value>
          </CustomField>
        </CustomFields>
        <IsPrimaryContact>boolean</IsPrimaryContact>
        <CustomerID>int</CustomerID>
      </contactModel>
    </EditCustomerContact>
  </soap12:Body>
</soap12:Envelope>
Response:


<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <EditCustomerContactResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Edit Customer Details

This function allows an existing customer to be edited.

customerId = the unique ID for the existing customer record stored in Anthill

You only need to pass the fields that need to be modified. The values for all other fields will be preserved.

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <EditCustomerDetails xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <customFields>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
      </customFields>
    </EditCustomerDetails>
  </soap12:Body>
</soap12:Envelope>
Response:


<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <EditCustomerDetailsResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

This function changes the marketing consent flag for an existing customer record.

When the flag is set to false the customer record will be suppressed from any marketing emails sent via Anthill.

customerId = the unique ID for the existing customer record stored in Anthill

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <EditCustomerMarketingConsent xmlns="http://www.anthill.co.uk/">
      <customerId>int</customerId>
      <marketingConsentGiven>boolean</marketingConsentGiven>
    </EditCustomerMarketingConsent>
  </soap12:Body>
</soap12:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <EditCustomerMarketingConsentResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Edit [Activity] Details

This function is used to edit an existing customer activity stored in Anthill.

Actual Method Names: AddLeadDetails, AddSaleDetails, AddFulfilmentUpdate

[Activity]Id = the unique Id for the existing activity in Anthill

You only need to pass the fields that need to be modified. The values for all other fields will be preserved.

Request:


<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <EditSaleDetails xmlns="http://www.anthill.co.uk/">
      <saleId>int</saleId>
      <customFields>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
        <CustomField>
          <Key>string</Key>
          <Value>string</Value>
        </CustomField>
      </customFields>
    </EditSaleDetails>
  </soap12:Body>
</soap12:Envelope>
Response: 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <EditSaleDetailsResponse xmlns="http://www.anthill.co.uk/" />
  </soap12:Body>
</soap12:Envelope>

Find Functions

Here we cover all of the available Find Functions associated with the Anthill API. This includes:

Find Customers

This function can be used to find customers based on a set of search criteria. It returns a page of results, along with the page number, number of records per page, total records and total pages. Each result will contain the Customer Id, Name, Type and Created date. To request subsequent pages, issue your API call again with the appropriate page number. The page size is limited to a maximum of 1000 results.

Each search criterion is made up of a field, an operation and a comma-separated list of arguments. For example, to search for all customers with a Last Name of ‘Smith’ that were created in the last 7 days, you would use the following criteria:

Field = “CustomField(Last Name)”, Operation = “Is”, Args = Smith

Field = “Created”, Operation = “DaysBetween”, Args = “0,7”

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <FindCustomers xmlns="http://www.anthill.co.uk/">
      <searchCriteria>
        <SearchCriteria>
          <FieldName>string</FieldName>
          <Operation>Is or IsNot or LessThan or LessThanOrEqual or GreaterThan or GreaterThanOrEqual or Between or DaysBetween or HoursBetween or DaysSince or HoursSince or DaysUntil or HoursUntil or StartsWith</Operation>
          <Args>string</Args>
        </SearchCriteria>
        <SearchCriteria>
          <FieldName>string</FieldName>
          <Operation>Is or IsNot or LessThan or LessThanOrEqual or GreaterThan or GreaterThanOrEqual or Between or DaysBetween or HoursBetween or DaysSince or HoursSince or DaysUntil or HoursUntil or StartsWith</Operation>
          <Args>string</Args>
        </SearchCriteria>
      </searchCriteria>
      <pageNumber>int</pageNumber>
      <pageSize>int</pageSize>
    </FindCustomers>
  </soap12:Body>
</soap12:Envelope>
Response: 
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <FindCustomersResponse xmlns="http://www.anthill.co.uk/">
      <FindCustomersResult />
    </FindCustomersResponse>
  </soap12:Body>
</soap12:Envelope>

Find Contacts

The function works in a similar way to the Find Customers function, however, each result will also include the associated CustomerID.

The following fields can be specified without the “CustomField” wrapper: Title, FirstName, LastName, Email, Telephone. So to find all the contacts with a LastName of “Smith” that were created in the last 7 days you would use the following criteria:

Field = “LastName”, Operation = “Is”, Args = Smith

Field = “Created”, Operation = “DaysBetween”, Args = “0,7”

Request:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthHeader xmlns="http://www.anthill.co.uk/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthHeader>
  </soap12:Header>
  <soap12:Body>
    <FindContacts xmlns="http://www.anthill.co.uk/">
      <searchCriteria>
        <SearchCriteria>
          <FieldName>string</FieldName>
          <Operation>Is or IsNot or LessThan or LessThanOrEqual or GreaterThan or GreaterThanOrEqual or Between or DaysBetween or HoursBetween or DaysSince or HoursSince or DaysUntil or HoursUntil or StartsWith</Operation>
          <Args>string</Args>
        </SearchCriteria>
        <SearchCriteria>
          <FieldName>string</FieldName>
          <Operation>Is or IsNot or LessThan or LessThanOrEqual or GreaterThan or GreaterThanOrEqual or Between or DaysBetween or HoursBetween or DaysSince or HoursSince or DaysUntil or HoursUntil or StartsWith</Operation>
          <Args>string</Args>
        </SearchCriteria>
      </searchCriteria>
      <pageNumber>int</pageNumber>
      <pageSize>int</pageSize>
    </FindContacts>
  </soap12:Body>
</soap12:Envelope>
Response:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <FindContactsResponse xmlns="http://www.anthill.co.uk/">
      <FindContactsResult />
    </FindContactsResponse>
  </soap12:Body>
</soap12:Envelope>

Error Codes

Anthill will return an exception if your API call is incorrect in some way. Where possible, the exception will include details as to what problem occurred.

Some other exceptions include:

“FaultException: Authentication Failed” – your API Username/Key combination is missing or invalid.           


If you have any other Integration Queries, please visit the Integrations Hub or Contact Us directly.


Jacob Goodwin -

Tags: ,

See how Anthill will reshape your business for the better

Master your processes, improve customer service & make more money!