Create data field

The CreateDataField method can be used to create a data field within your dotMailer account.

This is useful if you will need to dynamically create and store values within dotMailer relating to a contact.


Guidance Notes

You cannot create a datafield that already exists, if you are unsure which datafields currently exist please call ListContactDataLabels. The Data fields fieldName can only be up to 20 characters in length and must consiste of hyphens, underscores, and alphnumeric characters only. The data field that is created will be private by default. The amount of data fields you can create will be limited by the account type you have.


Parameters

username string This is the username from your API key. It is in the format of an email address and will look similar to apiuser‑908709770324@apiconnector.com required
password string This is the password from your API key. required
fieldname string This is the name of the data field you want to create. required
dataType This is the type of data that the data field will store. The possible values are String, Numeric, Date or Boolean. required
defaultValue This is the default value you would like the data field to store. optional

Return values

None.

Error responses

  • ERROR_DATAFIELD_INVALID
  • ERROR_DATAFIELD_LIMITEXCEEDED
  • ERROR_NON_UNIQUE_DATAFIELD
  • ERROR_APIUSAGE_EXCEEDED
  • ERROR_INVALID_LOGIN
  • ERROR_PARAMETER_INVALID
  • ERROR_SYSTEM_SERVICETEMPORARILYUNAVAILABLE
  • ERROR_UNKNOWN

Request

Example of use in C# .NET

Sample request

Sample response

Get started with dotMailer:

Small & Medium businesses Large businesses
Call the team on 0845 337 9170
What our clients say:

“dotMailer has changed our complete marketing process for the better. It's one of the easiest apps I have used and allows us to do things we have only dreamed of before."

Amberley Shermon, Cazenove+Loyd