- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 12:27 AM
Hi,
While testing virtual agent API using postman, I'm getting errors in the system logs (listed below). These errors occur only when I add 'history' attribute in the request body. If I don't add the attribute then there was no error. Anyone faced similar issue?
Errors:
VABotToBotRestMessageHandler :: Error in VA Bot to Bot Rest API.java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')
Error in va_bot_to_bot_provider_attributes : Cannot find function forEach in object [object Object].
OOTB sample Endpoint:
https://demoinstance.service-now.com/api/sn_va_as_service/bot/integration
Sample request:
1. request with history attribute in the request body
ServiceNow docs link to virtual agent API:
Thanks,
Kamal S
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 07:41 PM
A minor correction to the request body resolved the issue. Value of the history parameter should be sent as array of objects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 07:41 PM
A minor correction to the request body resolved the issue. Value of the history parameter should be sent as array of objects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 12:48 AM
Hi, I am also trying something similar but even with above format I am getting 400 error in rest API explorer, the error only occurs when I add history attribute without it its working fine getting 200 status code.
Can you please help me identify what could be the issue with using history attribute.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 06:01 AM
Make sure your endpoint is valid as per docs.
E.g., the default api is "https://instancename/api/sn_va_as_service/bot/integration"
Most likely the issue could be due to incorrect request format. You can also share your api request body, I'll check it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 08:04 AM
@Kamal17 Even though this is an old post, could you by any chance were successful in sending Rich Text to bot/integration and display it correctly in the chat window ? I am able to send link, Bold, Italics, but not able to embed image inside text and send it to ServiceNow via API call. Is this even possible or not ?