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:

  • GET
  • HEAD
  • POST
  • PUT
  • PATCH
  • DELETE

Here are all your options for writing functions within Tulip.

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.

To duplicate or delete the connector, got back to the Connectors page, and then click the three dots on the right side of the specific connector. 

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".

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" next to inputs to begin adding inputs. Example:

Then, add an endpoint to the end of the URL and choose the type of HTTP request.

Select "Query Params" to begin adding key/value pairs. Use your defined Inputs in the "Value" column.

Handling Responses

First, add a few outputs so you can map the contents of the response to Tulip.

The outputs will then appear as options in the "Response" section.

In the "Path" column, you will need to add some JavaScript to indicate the data from the body of the response that you would like to store.

For example, let's say that you write a GET request that returns an array of objects. You want to return the value of the name property from the first object in the array.

This is what you would write in the path field:

0.name 

You can also store values from the "Headers" and "Cookies" section of the response.

Similar to the section above, you must specify a specific output in the "Output" section. Then, use JavaScript to access the correct property from the JSON in the HTTP response.

Here is an example where an output named "csrf_token" stores the value called "x-csrf-token" from the property in the header.

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:

:regexp()

To capture multiple substrings within the string-

:regexpGroup()

Examples:

0.name:regexp(^N)
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.

parts[0].inputs:regexpGroup(^\w\w\s(\w\w)\s(\w\w)\s(\w\w),2)

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.

.[email:regexp(^N)]

We recommend RegExr to test your RegEx. Tulip uses the JavaScript (ECMA) RegEx engine.

Past Integrations

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:

Further Reading

Did this answer your question?