API2 Searchassets DATA object empty

Hello,

I’m running a self hosted version of Razuna 1.7 on Windows Server 2012 connected to a MSSQL database. There are 2 separate tenants set up.

When making the api call to search for assets, the DATA object in the response is empty. I have run the same script on test instances using the H2 embedded database, not sure of this is the issue or not. Please advise if there are any known issues with the API on the above setup, as well as any other potential issues with user or folder permissions. I have tested with both the admin API key as well as individual service account users.

The call’s to the API succeed, and return the column object but not any actually data. Here is an example in Javascript and C# (using Restsharp library) that have both worked in the past on other Standard instances:

JS:
$.getJSON(
“http://{mydomain}/razuna/global/api2/search.cfc?method=searchassets&api_key={ADMINORUSERAPIKEYTESTEDBOTH}&searchfor=abraham&__BDRETURNFORMAT=jsonp&callback=?”,
function(json){
//some parsing here
//json has Colums object but DATA is empty
}
);

C# (Utilizing Restsharp library):
static void RazunaSearch()
{
System.Uri uri = new System.Uri(“http://{mydomain}/razuna/global/api2/search.cfc”);
var client = new RestClient();
client.BaseUrl = uri;

        var request = new RestRequest();
        request.AddParameter("api_key", "{ADMINORUSERAPIKEYTESTEDBOTH}");
        request.AddParameter("method", "searchassets");
        request.AddParameter("searchfor", "*");
        
        IRestResponse response = client.Execute(request);

        dynamic responseObject = JsonConvert.DeserializeObject(response.Content);
        foreach (var searchObject in responseObject.DATA)
        {
            //some parsing here
            //responseObject.DATA is empty, responseObject has object array of Columns
        }
    }

Do you have any insight on what the issue may be?

Hi,
Did you verify that the data has been indexed properly? Try performing a search in the DAM and see if it returns any results.

Best
Harkirat

Results do indeed return in the Razuna search.

Are you using the right api key for the tenant? The api key is tenant specific so will only allow searching for the same tenant that the admin user belongs to.

Yes, I am using an administrator API key for that specific tenant that the assets are located on. (User > My Info >API Key tab OR in the Users administration).

I have debugged and figured out that I am able to return data for the “demo” tenant that is raz1, but unable to return search results for the other tenants. Any possible answers why this is the case?

Are any of the other API methods e.g. ‘getasset’ running on the tenant?

I am not sure if this was a permissions issue, indexing problem or what the cause was, but all of the sudden it started working as intended. It could have been that the data was not indexed immediately for the API search, which is why it was working on the “demo” tenant and not the others.

Perhaps there is a service that runs to update/index metadata fields? Anyway, thanks for the help and quick responses.

Glad to hear it is worked out for you in the end :slight_smile: