Convert to flat JSON
2 min
Convert a JSON array to a single JSON Object
API Definition
Convert to flat JSON API
Call the following API to convert using defaults:
POST
https://orca.pathfix.com/functions/list/toflatjson
json
{
"input": [{
"a": "val-a"
},
{
"b": "val-b"
},
{
"b": "val-b2"
}
]
}200
{
"output": {
"a": "val-a",
"b": "val-b",
"b_1": "val-b2"
}
}404
{
"message": "error"
}
Convert to flat JSON with Overwrite and ignore Keys API
Call the following API to convert using optional conversion rules:
POST
https://orca.pathfix.com/functions/list/toflatjson
json
{
"input": [{
"a": "val-a"
},
{
"b": "val-b"
},
{
"b": "val-b2",
"c": "val-c2"
}
],
"ignore_keys": "c",
"overwtite":"yes"
}200
{
"output": {
"a": "val-a",
"b": "val-b2",
"c1": "val-cb2"
}
}404
{
"message": "error"
}