Service Callout

As with the Internal API Call interceptor, Service Callout allows an API to invoke a call based on pre-defined settings. The difference is that, while the former redirects a call to APIs that are available in the Sensedia Platform, Service Callout allows invoking an external call.

Configuring the interceptor

The images and text below present the information that must be informed to configure the interceptor.

service callout screen
service callout body
service callout header
  • Variable name: it defines the name of the service callout, being unique per flow. The interceptor is retrieved inside the map $call.contextVariables using the name informed here. For this, the interceptor Service Mashup is needed.

  • URL: it defines the URL that will be invoked in the external request.

  • Method: it defines the HTTP method to be used;

  • Expected status: it sets the expected status code.

  • Preserve query string: if checked, the query string present in the request will be passed on to the external call.

  • Preserve body: if checked, the body contained in the request will be passed on to the external call. The field is enabled when the method is different from GET.

  • Body: it allows the insertion of a body. The field is enabled when the method is different from GET and the field Preserve body is unchecked.

  • Preserve headers: if checked, the headers present in the request will be passed on to the external call.

  • Headers: it allows the insertion of headers.

service callout asynchronous

Service Callout has the ability to make synchronous or asynchronous calls. In the latter case, a synchronous call will be sent to the new URL and the interceptor will await the result to continue the execution of the flow. For asynchronous calls, select the field Asynchronous.

The interceptor Service Mashup must be inserted in the API flow to allow capturing the response of asynchronous calls.

You can select the option Fire and Forget or leave it unchecked. If you select it, the interceptor will send the request and forget it, meaning that there will be no return from the external call.

When the option is not selected, you can configure a time limit for the external call to be made. The call will be terminated if the timeout reaches its limit or a result is returned.

service callout abort
  • Abort request if fail: it aborts the process if the request fails. A failure occurs when the status code of the request is different from the expected. The field is enabled when the request is synchronous.

How it works

The gateway executes the Service Callout interceptor and it is necessary that the interceptor Service Mashup be inserted in the API flow in order for the result to be retrieved.

The map $call.contextVariables must be used and it will return a RestResponse object.

Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]