Data Source using REST Integration Hub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 02:54 PM
Hi
I am trying to import data from an external API (Rest), I have created the Data Source Request action.
I have tested the Request Action within the flow designer and it is working well and I can see the Data I need on the the response_body of the API call
now when I am trying to run the "Test Load 20 Records" I am getting an error.
here is the Data Source I have set:
and this is the error I am getting :
the JSON file looks like this when I use PostMan to test the API connection :
Do you have any idea why I am getting this error ?
javax.json.JsonException: Cannot auto-detect encoding, not enough chars
please advice
Thanks
Aviram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 08:58 AM
May be helpful
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 10:04 PM
Thanks, I don't think I have an issue with special characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 02:29 PM - edited 02-02-2024 09:26 AM
Hi @Aviram Elkayam ,
That is because your response in the rest step is a json. It should be the sys_id of the attachment which SN creates internally. Re create your Action and ensure you don't use the import REST message option in the REST step, instead configure it manually and your response will be sys_id instead of the actual JSON.
The data source is expecting the sys_id of the attachment in the response_body instead of the actual json itself.
Regards
Shiva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 06:42 AM
Hi,
thanks, I will test that.
Recently I have solved the issue using Custom(Load by Script), see the javascript I have created