View servicenow_restmessagev2_response_as_attachment.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is where we'll save the attachment | |
var tablename = 'incident'; | |
var recordSysId = '8d6353eac0a8016400d8a125ca14fc1f'; | |
var filename = 'snlogo.png'; | |
// Let's download the ServiceNow Logo | |
var logoUrl = 'https://instance.service-now.com/images/logos/logo_service-now.png'; | |
var request = new sn_ws.RESTMessageV2(); | |
request.setHttpMethod('get'); | |
request.setEndpoint(logoUrl); |