Same API call - different results
Hi there,
currently I'm facing a strange thing using Lithium APIv1. I set up two different endpoints and each of them makes this API call:
<#assign roles = restadmin("/users/id/${uid}/roles").roles />
My test user has 4 roles assigned. One of my endpoints returns the correct 4 values. But the other one returns a list size of only 1 and the response can't be looped with freemarker.
I also tried to use hard-coded uid values, but the result is still the same.
***Update***
When sending the same API call from a custom component, I also get the correct dataset in response. Seems that only the specific endpoint run into this problem.
Has anyone faced a similar issue in the past or has some ideas/hints what went wrong here?
Thanks and best regards,
Christian
Hi jaread83
In order to obtain the most popular labels the API v2 labels would need to support both GROUP BY and SORT, which unfortunately they don't yet.
But there is some good news: You might actually not need to create a custom component. Take a look at the Lithium Studio documentation of the updated responsive labels widget labels.widget.labels-list as it allows for sorting and limiting the output to 5 labels as well: