|
|
Read and Update Event Custom Fields
Custom fields are the fields your workspace added to the event tabs (for example "Region" or "Booth contractor").
The API names each one by its field_name, such as custom_67890.
1. List your custom fields
Each field has its field_name, field_label, field_type, event_tab and is_hidden. The list does not include a dropdown
field's choices; if you send a value that is not one of them, the error lists them.
curl "https://api.exhibitday.com/v1/references/event_custom_fields" -H "api_key: YOUR_API_KEY" 2. Read the values
/v1/events/info returns an event with its custom_fields (label, value and field_name of each). For a list of events,
add hydrate_custom_fields=true to /v1/events.
curl "https://api.exhibitday.com/v1/events/info?id=12345" -H "api_key: YOUR_API_KEY" 3. Update a value
Pass the field_name as a parameter of PATCH /v1/events. Custom text, dropdown and URL fields can be updated; a
dropdown value must be one of its choices (the error lists them). The usual update rules apply: null (or the text
"null") clears the field, and an empty value leaves it unchanged and adds a warning.
A multi-line text field takes plain text, like the notes fields: html tags are stripped, line breaks become
<br/>, and the text is stored HTML-encoded, so it is returned as HTML (a < b comes back as a < b).
curl -X PATCH https://api.exhibitday.com/v1/events -H "api_key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"id\":12345,\"custom_67890\":\"Northeast\"}"
The response lists what changed, by the field's label:
{"status_code": 200, "status": "OK", "message": "Event Update Successful. Event properties that were changed: Region", "errors": []}
4. Filter events by a custom field
filter_by_custom_event_field__custom_67890=Northeast returns the events whose field has that value (text and
dropdown fields; the comparison ignores letter case).
curl "https://api.exhibitday.com/v1/events?filter_by_custom_event_field__custom_67890=Northeast" -H "api_key: YOUR_API_KEY" |