AI based Search using NLP in Service Now

iwsservicen
Tera Contributor

Hi,

I am trying to use the following API for AI based Search (AI Search Assist (Internal API)😞 

https://dev243998.service-now.com/api/now/aisa/search

 While trying to call this API, the Status code on Service Now is returned as 400, with the following output:

{
  "error": {
    "message": "INVALID_ARGUMENTS",
    "detail": ""
  },
  "status": "failure"
}

I need to pass query string to perform search throughout Service Now, such as tickets, articles etc. Can someone kindly help me out on how to call this API. Any help would be appreciated.

1 REPLY 1

Yang Xia
Tera Expert

Hi,

 

According to the Scripted REST Service (https://<instance_name>.service-now.com/sys_ws_definition_list.do?sysparm_query=name%3DAI%20Search%2... the Request Body needs to contain at least 3 key-value pairs.

 

{"searchContextConfigId":"","searchTerm":"","rpSysId":""}

You can get a searchContextConfigId from Search Application Configuration [sys_search_context_config] and rpSysId from Record Producer Configuration [aisa_rp_config].