If you want to connect an external system like an MES or ERP to Tulip, you will need to use an HTTP connector.
Within an HTTP connector, you can write a series of functions that will run common types of HTTP requests using predefined inputs. Options include:
Here are all your options for writing functions within Tulip.
You can customize your HTTP request with these options:
- Authentication (none, Basic Auth, OAuth 2)
- Request Headers
- Query Parameters
- Request Body (JSON, Form URL-Encoded or Plain Text)
- Response Body (JSON or XML)
Creating A Connector
Click the "Add Connector" button in the top right of the Connectors page, then name the Connector and select 'HTTP".
Then, you will see the Environments tab. If you want to set up multiple environments, see this separate guide.
Then, after selecting your Connector, choose "Add Connection Details" to add more details about the server you would like to query.
There are 5 options.
Running On: Most Tulip users should choose "Cloud Connector Host". If you are running Tulip on premises, refer to this guide on connector hosts.
Host: Only include the domain that you would like to query. Do not include http:// or https:// Eg. myaccount.restlet.api.netsuite.com
Port: This should be specified by the service you are querying. HTTP requests typically use port 443.
TLS: Select "Yes" if you are using HTTPS, and "No" if just "HTTP".
Click "Test" to see if you can successfully connect to the server, then click "Save".
To duplicate or delete the connector, go back to the Connectors page, and then click the three dots on the right side of the specific connector.
Creating a Function
Click the "Add New Function" button on the Functions tab to create a new function.
You will then see a series of options for editing your function.
First, name the function in the top left of the page.
Then, click "Add Function Inputs" to begin adding inputs. Example:
If you want to test your HTTP connector function, add a "Test Value" for each input.
Then, add an endpoint to the end of the URL and choose the type of HTTP request.
Select "Query Parameters" to begin adding key/value pairs. Use your defined Inputs in the "Value" field.
Add a $ before and after the Input name, for example, if the input name is "city_name", type in $city_name$.
After you are satisfied with your inputs and outputs, select "Test" in the top right corner to create a sample response.
You will see a JSON or XML response in the "Test Results" section. Now, you can map parts of this response to "Outputs" and then use them in apps.
XML extractors use XPATH syntax.
There are two ways to do this:
- Click on properties in the body of the response to map them to outputs
Here's how to specify the extractors using point and click:
Next, you will need to specify "extractors" next to each output to indicate the data from the body of the response that you would like to store.
This is what you would write in the path field:
You can also store values from the "Headers" and "Cookies" section of the response.
Here is an example where an output named "csrf_token" stores the value called "x-csrf-token" from the property in the header.
Outputs are stored as properties of an object when they are shared with an app. You must then store the object in a variable in an app. For more details, see this guide to using connector outputs with apps.
Using RegEx To Modify Outputs
You can also use RegEx to refine text values from the response. To do this, add one of these functions in the "Path" field to pass the value through a regular expression:
To capture multiple substrings within the string-
0.name:regexpGroup(^\w + (w+))
Using RegEx group, you may want to capture a single group within a larger string. To do this, add a comma to the end of your RegEx string and add the number of the specific group within the string.
Or, use it to select a specific item in an array that matches a rule. For example, the first object with an email value that starts with n.
Tulip can integrate with a variety of software systems. Here's a few examples of systems that have been integrated into Tulip in the past: