HTTP Actions

HTTP Actions make API calls to your business systems so you can build automations. They can be chained together in Compound Actions.

Set up an HTTP Action

You are able to setup an HTTP Action two ways:

  1. [Recommended] Import the entire HTTP Request via cURL.
  2. Manually select/create a connector + setup the API Request

Import from cURL

🚧

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.

Steps

  1. Get your cURL command:

    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


  2. Click IMPORT CURL

  3. Paste your cURL command into the text box.

  4. Double check everything is imported the way you expected.

Set up HTTP Action Manually

Prerequisite

Please make sure to setup the connector for this action. For more information, see Connectors Help Documentation

Steps

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

Use Variables

Inserting Variables

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 also reference variables from the HTTP Action Data Bank (like the current user)
    "{{meta_info.user.email_addr}}"
    

You can check variable names by looking at the Input Variables tab and our User Attributes Reference

Variable Escaping

By default all variables will be HTML escaped. This follows the Mustache templating language.

📘

Pro Tip!

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

Test your API

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.

❗️

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.

Once all your variables are configured, click TEST in order to kick off a Request with the example data you inputted in the Input Variables tab.

Prune Response Schema

You can filter out attributes from your HTTP action by deleting parts of the Output Schema on the right of the Response tab. Otherwise all data will be exported to the caller of this action (e.g. the compound action).

Save Action

When you choose to save the action, you will specify an API Name. This is the API Name that you will use in Compound Actions as the action.action_name.

If you created a new connector in the HTTP editor, you'll also be prompted to provide a connector name.


Troubleshooting

My HTTP Action is failing

  1. Check our logs to understand why.
  2. Requests will timeout after 60 seconds with no response from the requested server.
  3. Requests accept a max of 200kb responses.

How to pass an array through the POST Body

If you wish to pass an array through the POST body of an action, refer to the following steps:

  1. In the action body itself, refer to the array in triple braces without any quotes. For example:

{{{meeting_attendee_list}}}

no quotes.


  1. When you create inputs in the compound action, you need to stringy the array. For example your input arg would be:
1. data.input.$STRINGIFY_JSON()


Missing fields from an HTTP Action

If you have fields from an HTTP Action response that are missing in when the action is referenced in the compound action or from the bot's response.

This may occur due to the action filtering values based on it's action schema. To resolve this, ensure that all of the fields from the actions response are referenced in the output schema. To do this:

  1. Go to Creator Studio, select Plugins in the top bar, and then select actions.

  2. Select the action that is causing the missing fields.

  3. Select the "Response" tab

  4. Ensure that each response field from the API Response (left-hand side) is mentioned in the Output Schema (right-hand side). If you are unsure if all the fields are covered, you can select "Generate From Response" and we will generate a schema that includes every field from the API response.

  5. FYI: If you see the following text at the bottom of the response page, it means that Moveworks has detected a difference between fields in the API Response and in the Output Schema.