Call API Service Action

This operation can be used to call any external HTTP or HTTPS Web API services using different methods. The full result or a single hierarchical value can be assigned to a variable to be later used in the conversation flow.

Settings

The action uses the following settings:

Remarks

Connect will invoke the URL using standard HTTP format: any service available online can be invoked and interacted using this action.

API actions, like all other actions, are executed during flow execution by default. A slow API call can slow down your bot response times and performance. If your API is just receiving data but you're not using the results on the flow please consider using asynchronous mode.

The JSON service reply format setting will also enable standard RAW replies: Connect will accept and store in the target variable whatever the server will reply. If you specify a JSON Token Path on a non-JSON result the action will raise an error.

The XML service reply format will automatically parse both standard XML replies and SOAP envelope replies. Typical WSDL based services are perfectly invokable using this action.

Use Payload Mode to set the type of payload you're sending to your service and to change how Xenioo will format the request.

By default, Connect will add a charset=utf-8 string to the content-type header. Some older web servers might not accept this additional information. If so, remove it by disabling the "UTF-8 Payload Format" flag.

If you specify both Username and Password but do not enable Challenge Authentication Mode, Xenioo will automatically transform both into a base64 string and call the service using an additional Authorization/Basic header like the one below:

Authorization=Basic dGVzdDp0ZXN0

Connect will never add any header or default call value to the request. Any header or value that is required by your call will need to be fully added so that you have total control over each and every aspect of your API integration.

Connect variables can hold without content loss only string based content. If you choose to access a service that replies in binary content (like a service that replies with a pdf file or an image) choose BINARY format as result. Connect will automatically create a file with the result contents inside your account storage and return the full filename url inside the target variable. If the binary service is correctly exposing a content-type for the reply, Connect will automatically append to the downloaded file the correct extension.

Response Headers

Response Headers can be saved by this action by activating the Save Response Headers flag. When the action is executed, every headers sent by the server inside the response will be added to a JSON object into a variable named last_api_response_headers.

A sample headers variable is available below:

{
    "transfer-encoding":"chunked",
    "connection":"keep-alive",
    "access-control-allow-origin":"*",
    "content-type":"application/json",
    "date":"Wed, 10 Nov 2021 14:25:44 GMT"
}

Each field of the response headers can be accessed using Dynamic Parsing. For consistency among different systems and calls, all header key names are automatically translated to lowercase. Your dynamic parsing should take this into account when referring to specific fields.

Call Timeout

By default, Connect enforces a 10 seconds timeout on every API call executed by your chatbot. If your remote service needs more time to execute its operations please contact team@xenioo.com to discuss your backend requirements.

When timeout is increased for an account an additional action message is counted for any API call taking more than 30 seconds to complete.

Trigger

Call Completed. This action will trigger any child operation as soon as the service call is completed. The event will trigger whatever the call is successful or has failed.

Variables

This action produces the following variables:

Availability

Channel specific availability follows the table below:

This action can be used only inside interactions and not as child of other actions. This action requires a Premium Account to be used on a live chatbot.

Last updated