API DOCUMENTATION Last Update: Apr 2022

Manage Custom Reward Fields - List Fields

Show the fields used to gather rewards data:

 

The data to be submitted to the API is composed of the following fields:

 

  field   Example   Note
API 1.5 Required
user_id john1970 Required
user_api_key 1959caadac9b13dcb3 Required
type manage_reward_fields Required
action list Required
account_id greatwidgets Required
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:

  • Almost all users can access this call.

Example PHP Request:

If you are using PHP, the $data array would look like this:

  1. $data['API'] = '1.5';
  2. $data['user_id'] = 'john1970';
  3. $data['user_api_key'] = '1959caadac9b13dcb3';
  4. $data['account_id'] = 'greatwidgets';
  5. $data['type'] = 'manage_reward_fields';
  6. $data['action'] = 'list';

 

Success XML Response (lists ALL the existing fields):

  1. <response status="success">
  2. <account>
  3. <account_id>greatwidgets</account_id>
  4. <fields>
  5. <field>
  6. <name>reward_custom_field_1</name>
  7. <label>PCU</label>
  8. <show>Y</show>
  9. <type>Text</type>
  10. </field>
  11. <field>
  12. <name>reward_custom_field_2</name>
  13. <label>Category</label>
  14. <show>Y</show>
  15. <type>List</type>
  16. <choices>
  17. <choice>Beverages</choice>
  18. <choice>Food</choice>
  19. <choice>Other</choice>
  20. </choice>
  21. </field>
  22. </fields>
  23. </account>
  24. </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.

 

Error XML Response:

  1. <response status="error">
  2. <error>Error message</error>
  3. </response>