This is an older version of the Campaign Monitor API. We strongly encourage you to quit livin' in the past and use the shiny new RESTful version with lots of new functionality. You won't regret it.

List.GetCustomFields

Gets all the Custom Fields available for a list

Parameters and required information

Here’s a list of all the parameters you’ll need to pass to the List.GetCustomFields method. All of the parameters are required unless otherwise noted.

ApiKey
Your API application key. See here for more details.

ListID
The ID of the list whose custom fields should be returned. See here for more details.

Return Codes

Success

Upon a successful call, this method will return a collection of ListCustomField complex types. The individual ListCustomField record consists of a FieldName, Key, DataType and a list of possible options for multi-valued custom fields

Data Types

Text
A text valued custom field

Number
A number valued custom field

MultiSelectOne
A multiple option custom field where only a single option can be selected per subscriber

MultiSelectMany
A multiple option custom field where a subscriber can select many values

Error

100: Invalid API Key
The API key pass was not valid or has expired.

101: Invalid ListID
The ListID value passed in was not valid.

SOAP 1.1

The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx HTTP/1.1
Host: api.createsend.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.createsend.com/api/List.GetCustomFields"

<?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>
    <List.GetCustomFields xmlns="http://api.createsend.com/api/">
      <ApiKey>string</ApiKey>
      <ListID>string</ListID>
    </List.GetCustomFields>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?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>
    <List.GetCustomFieldsResponse xmlns="http://api.createsend.com/api/">
      <List.GetCustomFieldsResult>

        <ListCustomField>
          <FieldName>string</FieldName>
          <Key>string</Key>
          <DataType>string</DataType>
          <FieldOptions>
            <string>string</string>
            <string>string</string>
          </FieldOptions>
        </ListCustomField>

        <ListCustomField>
          <FieldName>string</FieldName>
          <Key>string</Key>
          <DataType>string</DataType>
          <FieldOptions>
            <string>string</string>
            <string>string</string>
          </FieldOptions>
        </ListCustomField>

      </List.GetCustomFieldsResult>
    </List.GetCustomFieldsResponse>

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

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /api/api.asmx/List.GetCustomFields?ApiKey=string&ListID=string HTTP/1.1
Host: api.createsend.com
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfListCustomField xmlns="http://api.createsend.com/api/">

  <ListCustomField>
    <FieldName>string</FieldName>
    <Key>string</Key>
    <DataType>string</DataType>
    <FieldOptions>
      <string>string</string>
      <string>string</string>
    </FieldOptions>
  </ListCustomField>

  <ListCustomField>
    <FieldName>string</FieldName>
    <Key>string</Key>
    <DataType>string</DataType>
    <FieldOptions>
      <string>string</string>
      <string>string</string>
    </FieldOptions>
  </ListCustomField>

</ArrayOfListCustomField>

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx/List.GetCustomFields HTTP/1.1
Host: api.createsend.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

ApiKey=string&ListID=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfListCustomField xmlns="http://api.createsend.com/api/">

  <ListCustomField>
    <FieldName>string</FieldName>
    <Key>string</Key>
    <DataType>string</DataType>
    <FieldOptions>
      <string>string</string>
      <string>string</string>
    </FieldOptions>
  </ListCustomField>

  <ListCustomField>
    <FieldName>string</FieldName>
    <Key>string</Key>
    <DataType>string</DataType>
    <FieldOptions>
      <string>string</string>
      <string>string</string>
    </FieldOptions>
  </ListCustomField>

</ArrayOfListCustomField>