Search API returns no objects

Not sure if this is the right way to ask a question about APIs. I am trying to do an API Search call using the following body:

{
“indices”: [
“identities”
],
“query”: {
“query”: “tags=XXX”
}
}

It returns no objects, When I do the same search in the search UI using tags=XXX it returns two objects (access profiles) that were tagged with the tag indicated. I checked the developer console and basically see the same API call there. Am I missing something in my request body to get the two access profiles?

Hi @PaulIAM,

Try changing the indices from identities to accessprofiles

{
   "query":{
      "query":"tags:*"
   },
   "indices":[
      "accessprofiles"
   ],
   "includeNested":false,
   "sort":[
      "name"
   ]
}

Thanks,
Sushant

Not sure why this worked now? I had tried it before with that indices as well and it returned nothing. Is there a required sequence of the various parameters? I tried including the fields parameter, but still shows all fields.

{
“query”: {
“query”: “tags=tagname”
},
“indices”: [
“accessprofiles”
],
“fields”: [
“name”,
“description”
],
“sort”: [
“name”
]
}