Loading...
Searching...
No Matches
ServiceNowRestClient Module

# ServiceNowRestClient Introduction

The ServiceNowRestClient module provides an API for calling ServiceNow REST services.

To use this module, use `"%requires ServiceNowRestClient"` in your code.

All the public symbols in the module are defined in the ServiceNowRestClient namespace.

The main classes are:

- ServiceNowRestClient: this class provides the REST client API for communuication with the ServiceNow REST API; it also automates authentication and authorization to the target
- ServiceNowRestConnection: provides a REST connection object to a ServiceNow server (based on the ConnectionProvider module)

Example:
  #!/usr/bin/env qore
  %new-style
  %strict-args
  %require-types
  %enable-all-warnings
  %requires ServiceNowRestClient
  hash<auto> opts = {
  "url": "https://dev493922.service-now.com/",
  "client_id": "b73a867187eb18f62d89820395417684",
  "client_secret": "M09tfOc&NoEP(XCEKkT:T&V<lKR%+=h9hw",
  "username": "admin",
  "password": "mypassword",
  };
  ServiceNowRestClient rest(opts);
  hash<auto> ans = rest.get("...");
  printf("%N\n", ans.body);

# Release Notes

## ServiceNowRestClient v1.1

- updated to no longer require OAuth2 login params (issue 4295)

## ServiceNowRestClient v1.0

- the initial version of the ServiceNowRestClient module