How to get tags details?

Hi all,

In my document I have added mixin type i.e. taggable i.e. tags and when I hit below url

" http://localhost:8080/cms/ws/rest/api/_query?language=xpath&statement/jcr:root/content//element(*,xapp:customtag) /@xapp:title /@hippostd:tags [
@hippostd:state=‘unpublished’ ]order by @hippostdpubwf:lastModificationDate descending"

“QueryResource” is getting called and tags data is not coming in response, I can print “hippostd:tags” as a column same I want it’s values i.e. tag1, tag2, tag3…etc.

@machak and @jasper.floor if you can help, would be appreciated!.

Hi @kumamanish ,

It seems like the issue you’re encountering is that the hippostd:tags property values are not being returned in the response of your XPath query. The query you provided is:

http://localhost:8080/cms/ws/rest/api/_query?language=xpath&statement=/jcr:root/content//element(*,xapp:customtag)/@xapp:title/@hippostd:tags[@hippostd:state='unpublished'] order by @hippostdpubwf:lastModificationDate descending

To retrieve the values of the hippostd:tags property, you need to ensure that the query is correctly structured to include the tags in the result set. Here is a revised version of your query that might help:

http://localhost:8080/cms/ws/rest/api/_query?language=xpath&statement=/jcr:root/content//element(*,xapp:customtag)[@hippostd:state='unpublished']/(@xapp:title|@hippostd:tags) order by @hippostdpubwf:lastModificationDate descending

This query selects elements of type xapp:customtag that are in the unpublished state and retrieves both the xapp:title and hippostd:tags properties. The order by clause ensures the results are sorted by the hippostdpubwf:lastModificationDate in descending order.

If you still do not see the hippostd:tags values in the response, it might be helpful to check if the hippostd:tags property is correctly set on the nodes you are querying and that the nodes match the criteria specified in the query. Additionally, ensure that the QueryResource is configured to handle and return the hippostd:tags property in the response.

Best Regards,
Bloomreach Team.