Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to call Agentic AI via Rest API call

Tushar_TJ
Tera Contributor

We have built some Agentic AI which needs to be called by third party apps via Rest API.

How to call Agentic AI via Rest API call?

2 REPLIES 2

Ct111
Tera Sage

check this video it will be good starting point for your usecase.

warren_chan
ServiceNow Employee
ServiceNow Employee

Try the Agent Invoker API:

 

var request = {
	targetRecordId: "25b65a1c936339100c8a30118bba10c7",
	targetTable: "incident",
	usecaseId: "78c687369f19d2d02b2d1597d90a1c97",
	conversationUser: "46d44a23a9fe19810012d100cca80666",
	objective: "Help me resolve the incident INC0010252",
	conversationLabel: "INC0010252: Incident Resolution"
};
var aiAgentRuntimeUtil = new AiAgentRuntimeUtil();
var response = aiAgentRuntimeUtil.startAiAgentConversation(request);
gs.info(JSON.stringify(response));