Support for text/csv API response
Genesys APIs generally return JSON structure to the client. We would like the option of triggering (select) API calls with Accept: text/csv
where the server processes the model to a tab-separated file for use in R and Excel.
Specifically, the call to https://beta.genesys-pgr.org/proxy/api/v1/acn/filter?d=ASC&l=100&s=seqNo with body:
{"geo":{"climate":{"bio1":{"ge":27,"le":31},"bio12":{"ge":585,"le":975},"bio18":{"ge":69,"le":115},"bio19":{"ge":1,"le":1},"bio4":{"ge":12,"le":36}}}}
that results in https://beta.genesys-pgr.org/a/v10afad41286924fca9954198a33c9587f should be able to return accession passport data in the tab-separated format. The object model/JSON needs to be processed so that all sub-objects are labeled by their JSON path (like geo.latitude
) and all arrays are converted to individual "columns" (e.g. storage: [ 10, 20 ]
would become storage1 = 10
, storage2 = 20
).
Any ideas?