Virtual Agent REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-04-2020 02:32 AM
Team,
I want to build a custom web application that enable users to chat directly with a Live agent. So I'm planning to use Virtual Agent REST APIs to pass chat to a live agent.
users in my web application would always need to chat with a Live agent, meaning it should always by pass Virtual Agent and go directly to Live Agent. Looking at VA REST API Documentation, is this the proper functional flow to get this working?
1. POST /api/sn_va_as_service/bot/integration and set the action to START_CONVERSATION to start a chat session.
2. POST /api/sn_va_as_service/bot/integration and set the action to AGENT to send user messages to Live Agent.
3. POST /api/sn_va_as_service/bot/integration and set the action to END_CONVERSATION to end chat with live agent
Regards,
Tamer
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-04-2020 10:08 AM
Hi Tamer - That is correct. In Quebec, you would be able to pass those as user commands in utterance but in Paris, you have to specify the action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-04-2020 10:12 AM
Thanks Shipra, actually I was trying this flow but it is not working, it seems I'm hitting this error, any idea how to resolve?
Execute operation on API 'ScriptableRESTResponse.getBody' from scope 'Virtual Agent API' was denied. The application 'Virtual Agent API' must declare a cross scope access privilege. Please contact the application author to update their privilege requests.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-04-2020 10:16 AM
Hi there,
Have you tried manually adding the Application Cross-Scope-Access record which the error mentions?
For example:
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â11-04-2020 10:50 AM
Shipra,
what I noticed is the following:
- I send a message with action set to "START_CONVERSATION", I pass the text "agent" so intent is resolved by engine and forward to Live Agent.
- User start chatting and all the messages are sent with action set to "AGENT", but none of the messages are delivered to Live agent.
However, if I didn't specific any action, and I follow the a flow similar to the experience you do fofromr ServiceNow portal, all work fine, meaning:
- I send hi to VA, no action set.
- VA replies back with buttons
- I send the value of the button that indicates Live Agent chat. No action set.
- Chat is transferred to Live agent, and all user messages are directed correctly to Live agent.
Is this an expected behaviour?