The API Field Name is a feature that works with the advanced API "addregistrations" when passing the "TaskResponses" JSON.
When creating custom forms (a type of YouLi Task response), you will see the option to set an API Field Name value for a custom field.
If you maintain a traveler portal that allows your travelers to register profile information, use this feature to pass that information along with the registration to a trip.
This saves the traveler from having to re-enter information, like passport, dietary preferences, etc.
How to Set?
Within a custom form task when adding or editing a field, just below the "REQUIRED" checkbox there should be a field called API FIELD NAME where you can set the value you must reference in the API.
NOTE: This only appears for custom forms when you have the Advanced API Enabled.
- Once set, it cannot be change
- The value must be unique across all fields for the same trip/template
- Only letters, numbers, underscore and dashes can be used to name API fields
- The API Field Name is not required when creating the form, but if it is not set, that field cannot be used in the addregistrations API call
To make the best use of this feature, create your custom forms (with API Field Names) on a template and then ensure all your trips are made from that template. That will ensure your API calls are successful since all the fields will have the correct API Field Names.
I am passing the field value but the task is not completed
Make sure you are providing all required fields for the task, otherwise the task will not be completed and saved. Check the warnings returned by the addregistrations call to see if this is the problem.
Make sure your API Field Names in the addregistrations API call match the values set in the custom form field.
I am not able to set the API Field Name
Make sure it is unique for ALL custom fields across ALL tasks in this trip/template.
Make sure you don't have special characters or spaces in the name.
I need to change the API Field Name
Once set, the API Field Name cannot be changed. But you can delete the field and make a new one with the new name.