@Inactive User - Ok. Good to know that you want your endpoint to return JSON which than can be requested by your components. You could use something like this to build your endpoint: <#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>
"${label.text}"<#if (label?has_next)>,
</#list>
]
}
}
<#else>
{
"response": {
"status": "empty"
}
}
<#recover>
{
"response": {
"status": "error",
"message": "${.error?json_string}",
"query" : "${queryMsg?json_string}"
}
} This should always return a JSON object from your endpoint. You should test your endpoint by directly accessing its Url, to see if things work as expected.
... View more