Create a Request

A Request must have a parent Base URL, from which it inherits the start of its URL (e.g. https://example_service/api/), and can inherit authenticatiom and headers (if they exist). A Request also contains other information such as -

  • The RESTful API method (e.g. GET, POST etc.)
  • The endpoint (the remaining part of the URL, which usually contains what you're asking the API to do, and the parameters that you're passing to it)
  • Request Parameters (the pieces of information you're passing to the API)
  • Response Definitions (the pieces of information you expect to receive from the API)
  • Authentication details (if you're not inheriting them from the Base URL)
  • Headers (if you're not inheriting them from the Base URL)

In the following step-by-step example, we will :-

From the Integrations page, click Create Request

Create Request Humley Studio

Select a Base URL

Select a Base URL which you intend to base the Request upon.

Enter in the sidebar -

  • Base URL Select a Base URL from the dropdown list and click Next

    If no Base URLs exist, or you need to create a new one, click Create Base URL and follow the instructions in Add the Base URL Details section on the Create a Base URL page.

Select a Base URL Humley Studio

Add Request details

Give the Request a name, define what API method it will be using, add the endpoint, and either inherit the authentication & headers from the Base URL or redefine them here.

Enter on the page -

  • Name Name the Request. All Request names must be unique within the Project.

  • Description (optional)

  • Request Type Select an HTTP method to call the API

  • Endpoint The remaining part of the URL that will be used to call the API Any request parameters included in the endpoint URL must be enclosed in curly braces e.g. update_record?record_id=102345&{request_def1}&{request_def2}

  • Body Enter the body of the request This is only available when a PATCH, POST, or PUT request type is selected

Add Request Details Humley Studio

Add Request Parameters

Define the names of the parameters that you may need to include in the API request's Endpoint. These will hold data that will be passed to the API.

Click the Request Parameters section to expand it

Expand Request Parameter section Humley Studio

Click Create Parameter

Enter in the sidebar -

  • Parameter Name Name the parameter. All parameter names must be unique within the request.

  • Help Text Enter help text. This will be displayed as a tool tip to give more information about the request parameter within Integration modules in Flows.

  • Mandatory Parameter checkbox Defaults to checked Check if this parameter is expected to be present in the API endpoint

    If parameter is not mandatory (checkbox is unchecked), another checkbox is shown -

    • NULL Parameter checkbox Defaults to checked Check if this parameter is to be replaced with a NULL value if it is not defined

      If parameter not to be replaced with a NULL value (checkbox is unchecked), a further field is shown -

      • Default Value field Enter a value that will replace the parameter if it is not defined

Add Request Parameter Humley Studio

In the sidebar, click Create Parameter to save your new request parameter.

Your new request parameter will be shown in the Request Parameters section's list. Create more as needed by clicking Create Parameter at the bottom of the list.

Request Parameter Saved Humley Studio

Once you've created the Request Parameters, don't forget to alter the API Endpoint part of the URL to reflect these.

In this example, the Endpoint has initially been added using hard-coded values -

  • convert?access_key=ACCESS_KEY&from=GBP&to=USD&amount=1

Change the Endpoint to replace the hard-coded values with the relevant Request Parameter names, within curly braces -

  • convert?access_key=ACCESS_KEY&from={from_currency}&to={to_currency}&amount=1

Alter the API Endpoint Humley Studio

You'll note that this API requires an access key. The ACCESS_KEY text will need to be replaced with the correct access key value also.

Add Response Definitions

Define the names of the response definitions that you may need to capture data passed back from the API.

Click the Response Definitions section to expand it and then click Create Definition

Expand Response Definition section Humley Studio

Enter in the sidebar -

  • Definition Name Name the definition. All definition names must be unique within the request.

  • Help Text Enter help text. This will be displayed as a tool tip to give more information about the response definition within Integration modules in Flows.

  • JSON Node Enter the name of the JSON node (on the API side) that will be passing back the data you want to store against this response definition

Click Create Definition to save your new response definition

Add Response Definition Humley Studio

Your new response definition will be shown in the Response Definitions section's list. Create more as needed by clicking Create Definition at the bottom of the list.

Add Response Definition Humley Studio

Save the Request

Save your new Request.

Click Create Request

Add Response Definition Humley Studio

The new Request will be shown on the Integrations list page under its parent Base URL

Add Response Definition Humley Studio

Still need help? Get in touch!
Last updated on 16th Dec 2019