XML and YAML on request
text/xml (or application/xml) returns XML with a root element and each array item in an _el element. text/yaml returns YAML. JSON stays the default.
API Maker
The framework for AI era
Database APIs
The client picks the format and the shape of the response with a header.
Every API answers JSON by default. Send x-am-content-type-response: text/xml or text/yaml and the same response comes back as XML or YAML. Two more headers change the case of the keys and flatten nested objects, so each client gets data the way it reads it.
Step through it, slow it down, or open the full canvas.
JSON by default. Every API answers { success, statusCode, data } in JSON: generated, custom and system APIs alike.
Every API answers { success, statusCode, data } in JSON: generated, custom and system APIs alike.
Send x-am-content-type-response: text/xml and the same response comes as XML, each array item in an _el element.
text/yaml gives YAML, for tools and configuration systems that read it. No conversion code on either side.
x-am-response-object-type: make_flat joins nested keys with an underscore: address.city becomes address_city.
x-am-response-case renames every key of the data: camelCase, PascalCase, snake_case, CONSTANT_CASE, param-case and more.
API Maker flattens first, then changes the case, then writes the format. Here: flat, camelCase keys, in YAML.
text/xml (or application/xml) returns XML with a root element and each array item in an _el element. text/yaml returns YAML. JSON stays the default.
camelCase, PascalCase, snake_case, CONSTANT_CASE, param-case, dot.case, path/case and more. Every key of the data is renamed, nested ones too.
make_flat joins nested keys with an underscore: address.city becomes address_city. Handy for grids, CSV and spreadsheets.
Generated, schema, custom and system APIs all read the same headers. No conversion code in any of them.
A custom API sets g.res.contentType to answer plain text or an HTML page, or returns a file to download.
Flatten first, then the key case, then the format. The headers combine freely.
A web app reads JSON, a legacy ERP only imports XML, and an operations tool keeps its data in YAML. They all call the same API with their own header, and nobody writes a converter.
GET /api/gen/admin/shop/main/products?limit=1&select=name,pricex-am-authorization: <API user token>x-am-content-type-response: text/xml<?xml version='1.0'?><root> <success>true</success> <statusCode>200</statusCode> <data> <_el> <_id>66f1c2…</_id> <name>Mouse</name> <price>19</price> </_el> </data></root>GET /api/gen/admin/crm/main/customers?limit=1&select=name,addressx-am-authorization: <API user token>x-am-response-object-type: make_flatx-am-response-case: camelCasex-am-content-type-response: text/yaml{ "address": { "zip_code": "395007" } } becomes addressZipCode: "395007" in the answer.
application/json (default), text/xml or application/xml, text/yaml, and text/plain or text/html for responses whose data is a string.
noChange (default), camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase and snakeCase.
Yes. With caching on, these headers are part of the cache key, so a JSON client never gets a cached XML answer.
Documentation