This example shows how the REST API requests can be created within ServiceNow to interact with the Buttonwood Broker.
Please refer to the Broker REST API Reference for further details on the REST API service.
Prerequisites
- This example has been tested against the following versions of ServiceNow:
- Jakarta through to Quebec
- This example has been tested against the following instance types of ServiceNow:
- Hosted
- Hosted developer clone
- Developer (this is a free service which can be requested via http://developer.servicenow.com)
- ServiceNow REST API support is provided through the IntegrationHub plugin
- An Authorisation Token for a Buttonwood Service Account will need to be generated to authorise communication with the Automate REST API service
- The Automate REST API Endpoint is in the form of https://<broker_fqdn_or_ip>/api/v1
- For an on-premise Automate appliance to communicate with a hosted ServiceNow instance, a ServiceNow MID Server will be required
Create a REST Message
- Log in to ServiceNow as an administrative user
- Navigate to System Web Services > Outbound > REST Message
- Click New to create a REST Message
- Enter the following details for the REST Message
- Name: Name for the REST Message
- Description: Description for the REST Message
- Endpoint: Broker Appliance REST API Endpoint URL
- Select the Authentication tab
Select the following options:- Authentication type: No authentication
- Authentication type: No authentication
- Select the HTTP Request tab
Insert new rows for the following headers:
Name Value Authorization Bearer ${BearerApiToken} Content-Type application/json - Click Submit
- The new REST Message appears in the list
- Click on the new REST API Message
A Default GET method is created automatically
Click the Default GET method
Click the Delete button to delete this method (new methods will be created) - Click New to create a new HTTP Method
Testing a REST Message
Using Variable Substitutions, REST methods can be tested to ensure that communication with the Broker REST API Service is successful and that methods have been correctly configured.
The following is an example of a test configured for the Deploy Blueprint method. Responses for each test call can be accessed via the Test Runs tab.