« Back to Documentation Overviewadd_account_custom
Section: Accounts
Version: 1.5.0
Add contact custom definition to account.
Conditions:
- name (mandatory) – Name of custom, must be composed using lowercase letters, digits and underscores only.
- content_type (mandatory) – Allowed values are string, number, date and phone.
- input_type (mandatory) – Allowed values are text, textarea, radio, checkbox, single_select and multi_select.
- is_hidden (mandatory) – Allowed values are true and false. Hidden custom is not visible for contact on his unsubscribe / manage details page.
- contents (mandatory if input_type is one of radio, checkbox, single_select, multi_select) - Provide list of contents to be available for selection from those input types.
Hint: You don't have to use this method unless you need to enforce specific content type or define multi content custom. Single content string customs are created on the fly when using methods such as add_contact or set_contact_customs.
Parameters
|
---|
string | API_KEY |
object | string | name | value | string | content_type | value | string | input_type | value | string | is_hidden | value | array | contents | string | value | string | value | string | value |
|
|
Return Value
|
---|
string | CUSTOM_ID | abc123 |
integer | added | 1 |
Example Request JSON
[
"API_KEY",
{
"name": "value",
"content_type": "value",
"input_type": "value",
"is_hidden": "value",
"contents": [
"value",
"value",
"value"
]
}
]
Example Response JSON
{
"CUSTOM_ID": "abc123",
"added": 1
}
Example Error Response JSON
{
"code": -1,
"message": "Missing contents"
}
Method-specific Errors
|
---|
Name already taken |
Missing contents |
API-wide Errors
|
---|
API key verification failed
| API key verification failed |
API client IP not allowed
| API client IP not allowed |
Invalid params
| Attribute params must be reference to hash |