askill
servicenow-http-integrations

servicenow-http-integrationsSafety 85Repository

Establish secure outbound integration connections using REST, SOAP, and HTTP protocols. Covers RESTMessageV2, OAuth token management, request signing, and response parsing. Use when integrating with external systems, implementing API clients, consuming REST/SOAP services, or managing OAuth authentication.

3 stars
1.2k downloads
Updated 3/9/2026

Package Files

Loading files...
SKILL.md

HTTP Integrations (REST/SOAP)

Quick start

Outbound REST requests:

var rest = new sn_ws.RESTMessageV2('IntegrationName', 'GET');
rest.setEndpoint('https://api.example.com/v1/users');
rest.setQueryParameter('page', '1');
rest.setHttpTimeout(30000);

var response = rest.execute();
var responseBody = response.getBody();
var status = response.getStatusCode();

if (status === 200) {
    var data = JSON.parse(responseBody);
}

OAuth token management:

var oauthClient = new sn_auth.GlideOAuthClient();
oauthClient.setCredentialId('5b61c16f73533300f662cff8faf6a74b');

var token = oauthClient.getNewAccessToken();
var accessToken = token.getAccessToken();

Secure request signing:

var request = new sn_auth.HttpRequestData();
request.setMethod('POST');
request.setEndpoint('https://api.example.com/data');
request.setHeader('Content-Type', 'application/json');
request.setBody('{"key":"value"}');

var credential = new sn_auth.AuthCredential();
var authRequest = new sn_auth.RequestAuthAPI().generateAuth(credential, request);
var authedData = authRequest.getAuthorizedRequest();

HTTP APIs

APIUse Case
GlideHTTPRequestBasic HTTP client operations
RESTMessageV2Outbound REST messages with full control
SOAPMessageV2SOAP web service calls
GlideOAuthClientOAuth token retrieval and refresh
RequestAuthAPICryptographic request signing

Best practices

  • Always check response status codes before parsing
  • Use RESTMessageV2 for complex REST integrations
  • Handle OAuth token expiration and refresh gracefully
  • Validate SSL certificates in production
  • Use SOAP messages for legacy integrations
  • Test timeouts on slow connections
  • Encrypt sensitive credentials using standard providers
  • Implement retry logic for transient failures
  • Log integration errors for troubleshooting

Response handling

if (response.getStatusCode() === 200) {
    var body = response.getBody();
    var contentType = response.getHeader('Content-Type');
    
    if (contentType.indexOf('application/json') >= 0) {
        var data = JSON.parse(body);
    }
} else {
    gs.error('API call failed: ' + response.getStatusCode());
}

Reference

For complete API reference, examples, and authentication patterns, see BEST_PRACTICES.md

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

84/100Analyzed 2/24/2026

High-quality ServiceNow HTTP integration skill with practical code examples for REST, OAuth, and request signing. Well-structured with clear when-to-use guidance, API reference table, and best practices. Uses standard ServiceNow APIs making it reusable across instances. Slight deduction for referencing external documentation for complete details.

85
85
78
80
82

Metadata

Licenseunknown
Version-
Updated3/9/2026
PublisherDanielMadsenDK

Tags

apitesting