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 configure JSON details for virtual agent API?

Junyu
Tera Contributor

Dear all,

I am working on Virtual Agent API (sn_va_as_service), I am following this video.

I don't know how to configure JSON (requestID, enterpriseID, clientMessageID etc.), For example in the tutorial:

find_real_file.png

 

 

If I want to talk to Virtual Agent on esc portal (or talk to Now Virtual Agent on MS Teams), how do I set it up?

Thanks for your answer.

1 ACCEPTED SOLUTION

Muralidharan BS
Mega Sage

This article will help you with the definitions of the requestid and etc,

 

https://community.servicenow.com/community?id=community_article&sys_id=080e3903dbc4e4107d3e02d5ca96198c

 

This docs will give you different json objects you can use,

 

https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/bot-api

 

Thanks

View solution in original post

3 REPLIES 3

Muralidharan BS
Mega Sage

This article will help you with the definitions of the requestid and etc,

 

https://community.servicenow.com/community?id=community_article&sys_id=080e3903dbc4e4107d3e02d5ca96198c

 

This docs will give you different json objects you can use,

 

https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/bot-api

 

Thanks

Muralidharan BS
Mega Sage

simple json to start conv, you can try in background scripts also.

{
   "requestId": "1234567",
   "token": "abcd",
   "nowBotId": "A85PWLERP",
   "enterpriseId": "ServiceNow",
   "clientSessionId": "",
   "action": "START_CONVERSATION",
   "message": {
      "text": "",
      "typed": true,
      "clientMessageId": "6543211"
   },
   "userId": "abel.tuter",
   "emailId": "abel.tuter@example.com"
}

Hello,

 

I am facing an issue with Virtual Agent API integration (Tokyo).

I am triggering the API with different user email and request ID in the payload but eventually it opens in the same Active Chat window which i accepted in the 1st call.

The "Chat with agent" highlighted in the image is the second call with different user.

Unable to figure out the issue.

 

Payload:

{
"requestId": "101", // changing the requestId
"token": "1234",
"nowBotId": "A85PWLERP",
"enterpriseId": "ServiceNow",
"clientSessionId": "",
"action": "AGENT",
"message": {
"text": "Chat with agent",
"typed": true,
"clientMessageId": "1"
},
"userId": "customer.c",
"emailId": "customer.c@example.com" // changing the email id 
}

 

Thanks in advance