Download a file via REST API from Excel?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 02:51 AM
Hi to everybody!
Hopefully I'm in the correct forum. I've managed do transfer data from a Servicenow instance to an Excel spreadsheet via REST API, mainly using code from this page: https://www.servicenowelite.com/blog/2015/9/22/connect-servicenow-to-microsoft-excel-with-rest-webse...
Where I've failed is to download a binary file (zip) from Servicenow. I have the url to download a file after I have provided my login data, but I'm still unable to automate the process via Excel and VBA.
Any help is greatly appreciated!
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 02:58 AM
Hi,
so what is the error when you consume the API?
Any authentication issue?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 03:10 AM
Hello Ankur,
a zip-file is downloaded, but it's not valid. I can't open it with 7zip and when I try to open it with firefox, the file only seems to contain the request, where the file should be saved.
Regards, Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 03:26 AM
Hi,
So it means the request is not being fulfilled properly with the API
Is this happening with every file
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2021 04:02 AM
Hi,
it seem to happen with every file type. The downloaded file obviously contains the code from the website instead of the file data.
I've tried different approaches to download a file and save automatically, but none was suucessful so far. Problem seems to be to provide the correct authentication data, but that's also a guess.
Regards, Rainer