Can the API respond in formats other than JSON?
Yes, it is possible to specify in the header or query parameters. In addition to the default JSON format, CSV and XML can also be selected. You can also select a JSON file that is compressed in ZIP format.
caution
Some models do not support formats other than JSON, such as authentication.
Specifying in the header
Specify in the Accept header.
Accept: text/csv
Accept: text/xml
または
Accept: application/xml
Accept: application/zip
Specifying in the query parameters
Specify in _output_format
.
?_output_format=csv
?_output_format=xml
?_output_format=zip
If you want to change the data structure of the CSV output by rewriting the headers, etc., refer to How to Implement Original Function into the Postprocess.
Support
If you have any other questions, please contact us or check out Our Slack Community.