I may have a case where I will need to make our event data available to new service.
They appear to have fixed fields for things, like “event_title”, and expect the incoming column headers to match. However, on the default CSV feed at /live/csv/events/, the column names don’t all line up. The service doesn’t appear to have a mapping feature.
There’s potential to bridge through Google Sheets, with its own benefits/risks. If I had to, but I’d rather not for the risk of breaking.
What seems to me a cleaner approach would be a custom API defined in LiveWhale to output the exact names and data the service needs, accessed through something like /live/csv-m/events/.
Does an option to develop a custom API like this exist? If so, are there any examples or documentation for doing so? If not, then I have to look at other options for this problem, like Sheets.
Hmm, the documentation notes that the handler may be limited to only “event_registrations”, “users”, or “quickaccess”. Not sure if it also includes events; I could test when/if this become a real need and not a preemptive investigation.
I’m also concerned that this would change all outputs of the given type, where I’m looking to make a custom CSV specifically for this use case.
Maybe it would just have to be a custom module or include file where event data is read and a separate, customized CSV file is built from scratch?
I didn’t notice what that handler’s limits were. That’s interesting. I suppose you could test just to make sure.
As far as limiting it to your specific CSV, you could do that in a custom module. We have created some modules in the past that check for a specific string in the live url, and then change the output if present.
You could format your url something like /live/csv/events/…/csv-m. Then your module would be set to only alter the output if “csv-m” is in the URL.
Thanks Jon and Nick – yes, I think Jon’s idea is the best one, and sorry for the confusion with those docs, the CSV display logic for /live/csv was consolidated since that doc was first written and it surely should apply to any /live/csv/events export you’d do – I’ve got that updated .
Maybe I’d suggest using a GET variable like /live/csv/events?rewrite_headers_for_service=1 and then your custom module could just wrap its code in a check for that GET variable before rewriting row 0 (header row) of the CSV output.