很抱歉,本页面中文版尚未完成,正在由Emarsys本地化团队努力筹备中。
Creates a new field in your contact database. This matches the functionality of the Field Generator in the application (Admin menu > Field Editor > New). Please note that you cannot create single- or multi-choice fields via the API, nor can you create more than one field at a time.
Endpoint
POST https://api.emarsys.net/api/v2/field
Parameters
Required parameters
Name | Type | Description | Comments |
---|---|---|---|
name | string | Name of the new field. | |
application_type | string | Type of the new field. | Supported types: shorttext (max 60 characters), longtext (max 255 characters), largetext (theoretically unlimited characters), date, url, numeric (max 24 digits). |
Optional parameters
Name | Type | Description | Comments |
---|---|---|---|
string_id | int | ID of the new field. |
Example Parameters
{ "name": "The name of the new field", "application_type": "shorttext" }
Result Example
Normal Result
{ "replyCode": 0, "replyText": "OK", "data": { "id": 111112222 } }
Error Condition
{ "replyCode": 9002, "replyText": "A field with this name already exists", "data": "" }
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 9001 | Invalid field name | No name was provided for the field. |
400 | 9001 | Invalid field string ID | The provided field ID is not valid (it must contain exactly 9 digits, with no letters or special characters). |
400 | 9002 | A field with this name already exists. | |
400 | 9002 | A field with this string ID already exists. | |
400 | 9003 | Reserved name. | |
400 | 9003 | Reserved string ID. | |
400 | 9004 | No more slots to create the field, please contact account manager. | |
400 | 9005 | Parameters name and application_type are required. | |
400 | 9006 | This type of field cannot be created via the API. | Single- and multichoice fields are not supported. |