i tried to use the rest message preview create the ui action but it is not getting any logs

chercm
Mega Sage

i tried to use the outbound rest message to create the ui actions but it is not getting logs . 

please help 

 

try {
gs.log('UI Action script started', 'DellSOAPRequest');

var r = new sn_ws.RESTMessageV2();
r.setEndpoint('https://apigtwb2cnp.us.dell.com/Sandbox/support/case/v3/WebCase');
r.setHttpMethod('POST');

// Set OAuth 2.0 authentication profile
r.setAuthenticationProfile('oauth2', 'Dell default_profile');
gs.log('Authentication profile set', 'DellSOAPRequest');

// Set HTTP headers
r.setRequestHeader('SOAPAction', 'http://ph.services.dell.com/Server/AlertOperation');
r.setRequestHeader('Content-Type', 'text/xml');
gs.log('HTTP headers set', 'DellSOAPRequest');

// Set request body with XML content
var xmlPayload = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://ph.services.dell.com/Server/">' +
'<soapenv:Header />' +
'<soapenv:Body>' +
'<ser:AlertRequest>' +
'<SourceHeader>' +
'<ClientId>730634</ClientId>' +
'<ClientType>HELPDESK</ClientType>' +
'<ClientHostName></ClientHostName>' +
'<ClientIPAddress>0.0.0.0</ClientIPAddress>' +
'<GuId></GuId>' +
'<ClientVersion></ClientVersion>' +
'<RequestId></RequestId>' +
'</SourceHeader>' +
'<CustomerHeader>' +
'<CompanyName></CompanyName>' +
'<CountryCodeISO></CountryCodeISO>' +
'<EmailOptIn></EmailOptIn>' +
'<PrimaryContact>' +
'<FirstName></FirstName>' +
'<LastName></LastName>' +
'<Country></Country>' +
'<TimeZone></TimeZone>' +
'<PhoneNumber1></PhoneNumber1>' +
'<EmailAddress></EmailAddress>' +
'<PreferContactMethod>email</PreferContactMethod>' +
'<PreferContactTimeframe></PreferContactTimeframe>' +
'<PreferLanguage>en</PreferLanguage>' +
'</PrimaryContact>' +
'</CustomerHeader>' +
'<AlertData>' +
'<EventId>2</EventId>' +
'<TrapId>0</TrapId>' +
'<EventSource>Server</EventSource>' +
'<Severity>3</Severity>' +
'<Message></Message>' +
'<Timestamp>2024-05-03T13:30:00+0200</Timestamp>' +
'<ServiceTag>APITG05</ServiceTag>' +
'<PartSerialNo></PartSerialNo>' +
'<FileToken></FileToken>' +
'<AgentSource></AgentSource>' +
'<DeviceName></DeviceName>' +
'<DeviceIP></DeviceIP>' +
'<DeviceModel></DeviceModel>' +
'<DeviceType></DeviceType>' +
'<OS></OS>' +
'<DiagnosticsOptIn></DiagnosticsOptIn>' +
'<CaseSeverity>Medium</CaseSeverity>' +
'<Code></Code>' +
'<RecommendationId></RecommendationId>' +
'</AlertData>' +
'<WebCaseOperation>' +
'<Operation>ALERTS</Operation>' +
'</WebCaseOperation>' +
'</ser:AlertRequest>' +
'</soapenv:Body>' +
'</soapenv:Envelope>';

r.setRequestBody(xmlPayload);
gs.log('Request body set', 'DellSOAPRequest');

// Execute the REST message
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();

// Log the response for debugging
gs.log('Response Body: ' + responseBody, 'DellSOAPRequest');
gs.log('HTTP Status: ' + httpStatus, 'DellSOAPRequest');
}
catch(ex) {
// Handle any exceptions that occur during the execution
var message = ex.message;
gs.log('Error: ' + message, 'DellSOAPRequest');
}

0 REPLIES 0