CURL --output command in Servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 03:03 PM
Hi,
I am using below CURL command to download a file from third-party which is working fine using CURL.
curl -X GET --user "apikey:{api-key}" \--output "test.docx" \
"https://api.us-south.language-translator.watson.cloud.ibm.com/instances/{instance-name}/v3/documents/{document_id}/translated_document?version=2018-05-01"
However, I am not finding an option of how to write the --output command in ServiceNow to download the file or at-least convert it to B64 & save as attachment.
Please help.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 03:15 PM
A script with a curl command may be saved on a mid server and executed using ecc queue.
Following page contains info on executing script using ecc queue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 03:47 PM
If it's required to save the file as an attachment, curl command can not be used.
Instead, create a server-side script to call a REST API with a get to fetch the content.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 07:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2020 08:46 PM
Attachment API can be used to POST to ServiceNow to attach a file. Would require a MID server. If the 3rd party IBM api is not connected via company vpn but is an external Internet URI, would require to use REST Message to GET the file.