API Configuration

Limited Preview

This capability is in Limited Preview. You can enable it by following the instructions here.

If you are you looking for the legacy HTTP Editor Guide, you can still view it here

Prerequisites

In order to follow this guide, you need to enable the Next-gen HTTP Editor first. You can do so by going to Creator Studio > Experimental Features

Click "Experimental Features" Tab

Then click Enable Next-gen HTTP Editor > Submit

Click HTTP Edit

Step 1: Import cURL Request

You can import your entire HTTP Request to shortcut the entire Connector + HTTP Request set up.

warning
  1. Importing cURL will overwrite all of the current work you have in the HTTP Editor.
  2. If the Request you are trying to import uses a 2-step Auth method like OAuth 2.0, then you will have to set up the connector manually AFTER importing cURL.
  1. Click IMPORT CURL

Click "Import cURL"

  1. Paste your cURL command into the text box.
Where to find cURL commands:
  1. You can typically find cURL commands in the API documentation for the source system you are trying to integrate with
  2. You can export your Postman requests to curl by clicking the </> icon on the right toolbar in Postman.

Copy and Paste cURL Command

  1. Double check everything is imported the way you expected. Follow on to Step 2 if you need to create a new connector or use an existing one.

View the import cURL command

Step 2: Set up Connector

Next, you may need to create a new Connector from scratch or use an existing one.

Connectors are used to securely store authentication information + base URL for the HTTP Request which can be reused for future requests. Previously created connectors can be used across new Paths & Queries use cases.

Option 1: Select Existing Connector

  1. Click Import Connector

Click "Import Connector"

  1. Search for your existing connector & then click APPLY

Search for existing connector

Option 2: Create New Connector

See our guide on Connector Configuration in order to set a new connector up.

Step 3: Set up HTTP Request

Known Limitations
  • Requests will timeout after 60 seconds with no response from the requested server.
  • Requests accept a max of 200kb responses.
  • XML Responses for Queries Workspace are not supported

Step 3.1: Set up Base Request Info

Base API Info

If you're manually configuring your API, you can do so by editing:

  1. Method - We support GET, POST, PUT, DELETE, PATCH methods.
  2. Endpoint URL - This is the rest of the URL Path starting from the end of the Base URL. It must start with a / .
    • Note: The Connector's Base URL and the inputted Endpoint URL are combined to create the full Request URL.
  3. Headers - ALL Request Headers must be added to this table.
  4. Query parameters - ALL Query Params must be added to this table. They cannot be saved in the Endpoint URL .
  5. Body - ALL Body content must be added to this text box.
    • Note: If you want to use Content-Type: x-www-form-urlencoded , you have to convert the data to the following format: key=value&key2=value2

Step 3.2: Use Variables in your Request

What Variables are available to me?

In Paths Workspace, you can use all of the Questions you have configured upstream of this HTTP Request + any User Attributes you have configured as variables

All of the variables that come from Paths Questions will be auto-populated in the Input Variables tab as a quick reference.

warning

User Attributes will NOT be populated in the Input Variables tab, however, you can view the User Attributes Reference here.

In Queries Workspace, you can use the query keyword + any User Attributes you have configured as variables.

All of the variables that come from the query keyword will be auto-populated in the Input Variables tab as a quick reference.

warning

User Attributes will NOT be populated in the Input Variables tab, however, you can view the User Attributes Reference here.

Queries pre-populated Input Variables

query inputvars

Paths pre-populated Input Variables from previous Paths Questions

paths inputvars

How do I reference Variables in my request?

You can use variables anywhere in the Headers, Params, Body, or Endpoint URL. They can also be used in JWT Connector Claims. You insert variables by using {{VARIABLE_NAME}}. You can check variable names by looking at the Input Variables tab and our User Attributes Reference

info

You can use {{{VARIABLE_NAME}}} if you need avoid HTML escaping the content of the variable.

Using mustache template to reference variables

If you use a variable in the request and want to Test your API, then you must add an example value to the variable in the Input Variables tab.

warning

This does not apply to User Attributes. User Attributes will pull from the information of the current user who is logged in and configuring the request.

Give variables example data

Using User Attributes in your API Request

Moveworks provides User Attributes that can be referenced in order to provide information about the current user to an API request. This includes data like user email address, user first & last name, user role & department, and any custom attribute.

In order to use a User Attribute in an API request, you must use the following syntax:

Copy
Copied
"{{user.email_addr}}"

Example:

User Attribute in API Call Example

Step 4. Test & Save your API!

  1. Click TEST in order to kick off a Request with the example data you inputted in the Input Variables tab.

Test API

  1. Get your API working and then save your connector for future use cases!

Save API

Moveworks IP Address Whitelisting

See our IP Address Whitelisting Reference here