4.3.4.12. Rest
The output format (json, xml or csv) will be chosen according to the metadata rest_output_format. Note that this metadata is automatically set if you use a REST Gateway IN in your channel.
The following properties are available:
In order to use them in any output format, there are some limitations about the message definition tree that you can use:
- Only the first two levels of the tree is used when asking for CSV output format. If the tree has at least 2 levels (beside the root node), the first level tags will be mapped into rows of the CSV, and the second level into columns. If the tree has only one level, fields will be only mapped into columns.
- If you use a CSV with headers, headers will be automatically calculated based on the element names of the first row.
Here is an example of an output file in the 3 formats:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<country><code>BE</code><name>Belgium</name></country>
<country><code>FR</code><name>France</name></country>
</root>
[
"country" : {
"code" : "BE",
"name" : "Belgium"
},
"country" : {
"code" : "FR",
"name" : "France"
}
]
code,name
BE,Belgium
FR,France