JSON to TOML
Try it interactively →POST /api/json-to-tomlConvert JSON to TOML. JSON objects become TOML tables; arrays-of-objects become arrays-of-tables; nested keys are flattened with dot notation.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| json* | string | — | JSON object as a string. |
Response
Modes: json, text. Cache: yes (24h TTL).
Code samples
Built from the config example.
curl -X POST https://api.xtract.bot/api/json-to-toml \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"json": "{\"title\":\"config\",\"server\":{\"host\":\"0.0.0.0\",\"port\":8080,\"features\":[\"a\",\"b\"]}}"
}'