REST 2.0 Asset search not returning expected values consistently


#1

Hello and thanks in advance for any help. I am trying to use the REST 2.0 interface to query RT for an Asset’s ID. The response I get has been inconsistent for the same query. I was wondering if anyone else is having this issue. I am using CURL to test my query and have followed the documentation. I have tried this on Ubuntu, RHEL and Windows 10 with the similar results. Any hints or help would be appreciated.
We are using RT 4.4.2 currently

Here is the query
curl -si
-H “Authorization: Token #####”
https://rt2.X.X/REST/2.0/assets
-X POST --data-binary ’
[
{ “field”: “Name”,
“operator”: “LIKE”,
“value”: “Test Asset” }
]’

When it works (or what I consider as working) it returns the following
{
“count” : 1,
“page” : 1,
“per_page” : 20,
“total” : 1,
“items” : [
{
“id” : “42”,
“type” : “asset”,
“_url” : “https://rt2.X.X/REST/2.0/asset/42
}
]
}

When it fails (again as I define fail) for the exact same query, it returns no items
HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.12.2
Server: nginx/1.12.2
< Date: Wed, 27 Feb 2019 16:31:22 GMT
Date: Wed, 27 Feb 2019 16:31:22 GMT
< Content-Type: application/json; charset=“utf-8”
Content-Type: application/json; charset=“utf-8”
< Content-Length: 87
Content-Length: 87
< Connection: keep-alive
Connection: keep-alive

<
{
“count” : 0,
“page” : 1,
“per_page” : 20,
“total” : 0,
“items” : []
}

  • Connection #0 to host rt2.X.X left intact

Thanks for taking a look and providing any assistance


#2

Hey,

Are you sending the same query? Anything in the server logs?


#3

Do you have the same inconsistent results when doing other searches on other fields?

What if you GET a specific asset instead of doing a search?