Thanks! I just added a few things to it to get it to work 100%: <#attempt>
<#assign someLabels = restadmin("/categories/id/discovery/labels?restapi.response_format=json").labels.label />
<#if someLabels?? && someLabels?size gt 0>
{
"response": {
"status": "successful",
"labels" : [
<#list someLabels as label>
{"id":"${label.id}","text":"${label.text}"}<#if (label?has_next)>,
]
}
}
<#else>
{
"response": {
"status": "empty"
}
}
<#recover>
{
"response": {
"status": "error",
"message": "${.error?json_string}",
"query" : "${queryMsg?json_string}"
}
}
... View more