IntegrationHub API allows to launch integration scenarios from external sources via several methods.
API Authentication
IntegrationHub API supports three methods of authentication:
- allowing anonymous triggers via Scenario advanced settings
- authorization header added to your request
- Azure AD Authentication (this option is currently supported only for on-premises version of IntegrationHub).
Allowing anonymous access
This access method should be configured for each specific scenario.
To allow anonymous scenario triggering:
- Navigate to Integration > Scenarios page and find the scenario in question in the list.
- Click on the down arrow icon next to the scenario and choose Edit.
- Click on Advanced edit button in the upper right part of the page.
- On the Advanced edit page, scroll down to the bottom of the page, mark the Enable External Triggers checkbox and after that the Allow Anonymous Triggers checkbox.
Using authorization header
You can authenticate by adding the following authorization header to each of your requests to IntegrationHub API:
Authorization: <bearer> <token>
To get your personal access token, please do the following:
- Launch IntegrationHub and click on the User account in the upper right corner of the page.
- Select API token option in the menu. The API Token page will be opened.
- Copy the access token from the Personal Token field.
Azure AD Authentication (on-premises version only)
In order to use Azure AD Authentication, you need to register an app in the Azure Active Directory and make sure, that the Allow implicit flow option is enabled for this app.
After that, you can configure API access via this app during the installation of IntegrationHub on-premises version by providing the following credentials:
- Azure AD Tenant ID
- Azure AD user group (optional)
If you have already installed IntegrationHub on-premises, you will need to reinstall or update it to the next version to configure these options.
Allowing external launch for a specific scenario
To launch a scenario this way, you need to allow external triggers for each specific scenario first. To do so:
1. Navigate to Integration > Scenarios page and find the scenario in question in the list.
2. Click on the down arrow icon next to the scenario and choose Edit.
3. Click on Advanced edit button in the upper right part of the page.
4. When the Advanced edit page opens, scroll down and click the Enable External Triggers checkbox.
Note, that when this checkbox is enabled, you will see a hint containing valid URL for external GET requests (e.g. URL: [YourIHTenant]/ExternalData/Accept/1a990d32-1299-4c6e-9ac7-aa1800cde08d)
Important note: By default, the external triggers authenticate using IntegrationHub cookies in your browser local storage. If you need to enable external launch from another browser or PC, you also need to mark the Allow Anonymous Triggers checkbox, which is located right under the Enable External Triggers checkbox.
GET request
GET https://[YourIHTenant].com/ExternalData/Accept/[ScenarioID]
The easiest way to launch a scenario with [ScenarioID] externally if no complex data transfer is needed.
Expected response: empty HTTP response with Status Code 200 (OK).
POST request
POST https://[YourIHTenant].fluenthub.com/ExternalData/Accept/[ScenarioID]
The request body can be:
- submit form
- request indicating content type (supported formats: application/json, application/xml)
Note, that when launching a scenario this way, the data source will not be polled, request content will be used instead.
You can get the request data in Source Script using the data[0].Body context variable.
Expected response: empty HTTP response with Status Code 200 (OK).
Access internal data storage
This method allows getting cached data from IntegrationHub internal storage, which can be used for integration with third party systems using custom integration scenarios:
GET https://[YourIHTenant].fluenthub.com/ExternalData/GetCacheData/[ScenarioID]?keyJson=[key]
Expected response: HTTP response withStatus Code 200 (OK) and requested data in JSON format.