Get custom fields list
Fields collection allows retrieving information about all defined subscriber custom fields (custom subscriber properties) in business unit.
Request data format
Request URL parameters:
Parameter | Type | Notes |
---|---|---|
apiKey | string | Your API key, required for authentication. Required. |
Examples:
https://api.esv2.com/v2/Api/Fields?apiKey=test_api_key1
Response#
Element/attribute | Type | Notes |
---|---|---|
Fields | array[complex] | Array of Field elements. |
Field element children:
Element/attribute | Type | Notes |
---|---|---|
Id | int | Custom field identifier. |
Name | string | Custom field name. |
FriendlyName | string | Custom field „friendly” name for display purposes. |
Type | string | Custom field type. One of: Text, Number, Money, Date, Datetime, SingleSelect, Boolean, Url. |
DefaultValue | mixed | Custom field default value. Content depends on field type. Optional. |
Description | string | Text description of custom field. Optional. |
Visible | boolean | True, if custom field is visible to subscribers in e.g. Preference Center. |
Required | boolean | True, if custom field is required when subscribing to a list. |
Examples
Request:
GET https://api.esv2.com/v2/Api/Fields?apiKey=test_api_key1 HTTP/1.1
Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
OK response:
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
Set-Cookie: TEMP_DATA=c0d53e6c-d043-474f-b899-c7bc080f637d; path=/
X-Powered-By: ASP.NET
Date: Mon, 02 Feb 2015 17:06:10 GMT
Content-Length: 1877
<ApiResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Data>
<Fields>
<Field>
<Id>1</Id>
<Name>booltest</Name>
<FriendlyName>Test Boolean Field</FriendlyName>
<Type>Boolean</Type>
<DefaultValue>1</DefaultValue>
<Description>This is a test boolean field with default value.</Description>
<Visible>True</Visible>
<Required>False</Required>
</Field>
<Field>
<Id>2</Id>
<Name>reqtext</Name>
<FriendlyName>Required Text Field</FriendlyName>
<Type>Text</Type>
<DefaultValue />
<Description>This is a test text value which is required.</Description>
<Visible>False</Visible>
<Required>True</Required>
</Field>
<Field>
<Id>3</Id>
<Name>numtest</Name>
<FriendlyName>Test Number Field</FriendlyName>
<Type>Number</Type>
<Description>This is a test number field.</Description>
<Visible>False</Visible>
<Required>False</Required>
</Field>
</Fields>
</Data>
</ApiResponse>