SERVICENOWcustom takes in any API requests and parameters to make the API call and return the response. First, the function checks if the token Key exists or has expired and performs the OAuth2.0 authentication workflow to obtain the token to be used in subsequent requests. Uses the passed configurations API request parameters - the method (ex. post), ServiceNow API endpoint (ex. 'now/table/') and parameters for the call (ex. the incident ticket) - to build and carry out the appropriate HTTP request. For resiliency, the Retry Library is used to retry any failed attempts and the response is handled and returned.
|