REST Hooks
In the Composition tab, the REST Hook option is available within the Integration menu. It is used to make a REST call to an external system.
Procedure
-
Drag Integration >REST Hook in to your flow.
-
Check Editable flag if you want to edit these parameters while editing the service instance.
-
On the Composition tab, enter the following values for the REST Hook activity in the Create tab for provisioning:
Note: For behind the proxy set up, make sure proxy environment variables (http_proxy, https_proxy) are set during the installation of Managed services.
- Activity Id - The activity Id is automatically generated and is in read-only mode.
- Title - Enter the name or the title of the REST Hook.
-
Input URL - Enter the URL where payloads are delivered. You can pass JSON data in REST Hook URL.
Tip: The assistive user interface starts to provide suggestions when you type "$" sign. You can select from the interpolation options, such as ${input_parameters, ${datatypes. After you select the interpolation option, enter "." for the user interface to list all probable input parameters that are defined prior to this Rest Hook activity.
Important: Service Composer only supports JSON format for Rest Hook URL. If you include a Rest Hook activity in your composer that does not return a JSON format, then the primary flow fails without triggering a corresponding error flow.
-
Method - Select the Method. It includes GET, POST, PUT, PATCH, and DELETE.
-
Payload - Enter request or response body. Quotes must only be added for parameters of type String or Password. For Counter, List and Map, you have to stringify the JSON if any of the parameter value is a linked parameter.
For example, name is a string and amount is a non string:
{ \“name”: \“${param.name}\”, \“amount\”: "${param.amount}" }
Tip: The assistive user interface is available for Payload. It allows you to easily enter multiple interpolations. Enter "$" sign for the assistive user interface to provide you suggestions everytime you want to add an interpolation.
-
In the Header/Auth section, enter the following values:
- The KEY and VALUE are displayed for existing header keys and header values. Click Edit to add or delete header keys. You cannot edit an existing header.
- Auth Type - Select the authentication mechanism.
Basic
is the only authentication type supported in this release. -
Auth Username - Enter the user name for REST Hook authentication management system to which you want to add an entry after a template is deployed. You can use REST Hook to connect to the IT asset management system to create an entry.
Tip: The assistive user interface allows you to associate a input parameter to user name so that you can retrieve the user name dynamically during runtime. Enter "$" sign for the assitive user interface to provide you suggestions.
- Auth Password - Enter the password for REST Hook authentication. For example, a REST API enabled IT asset.
-
Open the Destroy tab and enter values to define the REST Hook during deprovisioning. The values in Destroy tab for deprovisioning is same as values in Create tab.
For supported interpolations, see Input and output parameter mapping for REST Hook.