External Web Call

 

Within SmartFlows, use the External Web Call module to set up an external web call to send and receive information. An HTTP request allows you to interact with applications and code outside of SmartFlows.

 

SmartFlows encrypts the External Web Call configuration at rest for additional security.

 

  1. To edit your configuration details, click the here link in the message. Your configuration will open and you can make changes.

Click Save and the configurations are hidden and re-encrypted.

Transition Triggers

The external web call has two events under the action dropdown that trigger transitions.

 

  • Success: A connection was made.
  • Fail: The URL does not successfully return or has an error.

 

Response variables

Once the external web call returns a valid JSON object, select the data and create your variable.

Note: This is an example response using dot notation, array[0].first_name, to access the contents of an item in an array.

[

   {

        “_id”: “5c86c534307bb30000jkjaa”,

       “first_name”: “John”,

        “last_name”: “Smith”,

        “pin”: 7777,

    }

]


Fields

Headers
Use HTTP headers to pass additional information to the API endpoint with the request.

 

  • Use them to add metadata to the request.
  • The accepted headers are based on what is configured in the API endpoint and should be present in the API documentation.
  • Authorization/key.

Username and Password

These fields support basic authentication in the event that it is required for access to the API endpoint.

 

  • Token-based authentication can be supported by adding a custom header to the request.
 
Method

Indicate the action for the URL to perform per the API configuration.

 

These methods are supported by SmartFlows but depend upon the specific API configuration.

 

Note: Currently, POST, GET, and PUT are available to support submitting information and extracting information, respectively. More methods will be added soon.

Timeout

Set the timeout duration in seconds that SmartFlows should wait for the API response before failing the request.

 

  • The default is set to 10 seconds. Most requests are returned in less than a second.
  • A best practice is to keep this to a short time window to prevent consuming capacity unnecessarily.
 
URL of Service

Enter the URL of the API endpoint here.

 

  • Variables can be used inside URLs to target specific objects.
 
Response Variables

Extract JSON/XML responses into named variables.

 

  • When a request is sent, the entire response is collected in a variable called EXTCALL_6.responsebody.
  • User-configured response variables, however, offer more granularity and allow the user to extract a subset of the response.

    For example, to extract the value orderStatus from their API, add a response variable with that name to the external web call action. The name must be a literal match to the name sent by the API.

  • The extracted data is stored in a SmartFlows variable of the same name. This variable can then be invoked in later parts of the flow using the following syntax:

$EXTCALL_6.orderStatus

 

This variable also appears in the Available Variables section of the action configuration panel in subsequent actions. There, it can be used in messages, text-to-speech, analytics, and other web calls.

 
Variables

The external web call action creates several variables.

 

User-configured response variables.

 

Any key in the API that matches a named response variable on the web call action will allow its corresponding value to be stored in the response variable.

 

  1. responsebod:The entire response from the external API.
  2. Statuscode: The response code generated from the API (e.g. 200 for success, 400 for bad request, 404 not found, etc.)
Test HTTP Request

Once you have entered all of your desired web call configurations, you can test your request right in SmartFlows and preview the response using the Test HTTP Request button. Here’s how it looks with an example configuration for a flow that creates a Trello card when a text message is received.

SmartFlows will then make an API call to your service and display the response in a window.

 

This is an example of Trello’s response when the request is successful:

This is an example of Trello’s response if the wrong token is sent:

 

 

This feature will help you debug your API configuration and get your integrations up and running faster.