Manage Customer Fields - Update
Update the status of fields used to gather customer data:
Headers
|
|
Key |
|
Value |
|
Note |
|
|
|
api_access_key |
|
user_api_key |
|
Optional |
|
   
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.6 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required if not included in the headers |
|
|
|
type |
|
manage_fields |
|
Required |
|
|
|
action |
|
update |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
custom_field_#__label |
|
Marital Status |
|
optional |
|
|
|
custom_field_#__show |
|
N |
|
optional |
|
|
|
custom_field_#__type |
|
List |
|
See Note |
|
|
|
custom_field_#__choices |
|
Single, Married, Other |
|
optional |
|
|
|
custom_field_#_searchable |
|
Y |
|
optional |
|
|
|
custom_field_#_required |
|
Y |
|
optional |
|
|
|
web_update |
|
Y |
|
optional |
|
|
|
|
|
|
|
|
|
|
|
Output Format: |
|
|
|
output |
|
JSON or XML |
|
Optional. If not provided, defaults to XML |
|
|
|
callback |
|
someFunctionName |
|
Optional: JSONP format |
|
|
|
condensed |
|
yes |
|
Optional (No white space) Applies only to JSON(P) output |
|
|
|
|
|
|
|
|
|
NOTE:
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'manage_fields';
- $data['action'] = 'update';
- $data['card_number_label'] = 'Member #';
- $data['card_number_show'] = 'Y';
- $data['country_show'] = 'N';
- $data['custom_field_3_label'] = 'Gender';
- $data['custom_field_3_show'] = 'Y';
- $data['custom_field_3_type'] = 'Pick';
- $data['custom_field_3_choices'] = 'Male, Female, Other';
- $data['custom_field_4_label'] = 'Allow SMS';
- $data['custom_field_4_show'] = 'Y';
- $data['custom_field_4_type'] = 'Text';
Success XML Response (lists ALL the existing fields):
- <response status="success">
- <account>
- <account_id>test2009050502</account_id>
- <fields>
- <field>
- <name>card_number</name>
- <label>Member #</label>
- <show>Y</show>
- <type>Text</type>
- </field>
- <field>
- <name>first_name</name>
- <label>First Name</label>
- <show>Y</show>
- <type>Text</type>
- </field>
- ...
- <field>
- <name>country</name>
- <label>Country</label>
- <show>Y</show>
- <type>Text</type>
- </field>
- <field>
- <name>custom_field_3</name>
- <label>Gender</label>
- <show>Y</show>
- <type>Pick</type>
- <choices>
- <choice>Male</choice>
- <choice>Female</choice>
- <choice>Other</choice>
- </choice>
- </field>
- <field>
- <name>custom_field_4</name>
- <label>Allow SMS</label>
- <show>Y</show>
- <type>Text</type>
- </field>
- </fields>
- </account>
- </response>
NOTE:
- The <show> response indicates whether or not this field ought to be shown or not. Usually fields with "N" will have nothing in them. However, it is allowed to add content to any defined field through the API regardless of their <show> status.
Example Request 2 (without any fields passed, and "web_update+ set to "Y")
(ie: All fields were unchecked -- Not likely but given as an extreme example):
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['type'] = 'manage_fields';
- $data['action'] = 'update';
- $data['account_id'] = 'greatwidgets';
- $data['web_update'] = 'Y';
Success XML Response:
- <response status="success">
- <account>
- <account_id>test2009050502</account_id>
- <fields>
- <field>
- <id>card_number</name>
- <label>Card #</label>
- <show>N</show>
- </field>
- <field>
- <id>first_name</name>
- <label>First Name</label>
- <show>N</show>
- </field>
- ...
- </fields>
- </account>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|