FLOW_CallApi
Class · Group: Web Services
apex
global inherited sharing class FLOW_CallApiInvokes web service calls synchronously, allowing for integration with external systems from Salesforce using Lightning Flow or Process Builder. Receives a list of requests, sends them to their respective endpoints, and returns responses as structured data.
Since: 1.0
Example:
apex
FLOW_CallApi.DTO_Request request = new FLOW_CallApi.DTO_Request();
request.apiName = 'API_GetCustomerInfo';
request.recordId = recordId;
request.inputs = 'customerId=5678';
List<FLOW_CallApi.DTO_Response> responses = FLOW_CallApi.invokeApiCallSynchronously(new List<FLOW_CallApi.DTO_Request> {request});Methods
| Method | Description |
|---|---|
| global static List invokeApiCallSynchronously(List<FLOW_CallApi.DTO_Request> requestDataTransferObjects) | Invokes web service calls synchronously using a list of DTO_Request objects. |
Inner Classes
| Class | Description |
|---|---|
| DTO_Request | Data Transfer Object representing the web service call request. |
| DTO_Response | Data Transfer Object representing the web service response or errors. |
Method Details
invokeApiCallSynchronously
apex
@InvocableMethod(category='Api Callouts' description='Makes a real-time HTTP callout to an external system using a configured API handler. Use when a Flow needs to send or retrieve data from an external service and wait for the response.' label='Invoke Callout Synchronously' callout=true) global static List<FLOW_CallApi.DTO_Response> invokeApiCallSynchronously(List<FLOW_CallApi.DTO_Request> requestDataTransferObjects)Invokes web service calls synchronously using a list of DTO_Request objects.
Parameters:
requestDataTransferObjects(List) - The list of web service requests to execute.
Returns: FLOW_CallApi.DTO_Response - List The results of the calls.
Since: 1.0
Example:
apex
List<FLOW_CallApi.DTO_Request> requests = new List<FLOW_CallApi.DTO_Request>();
FLOW_CallApi.DTO_Request request = new FLOW_CallApi.DTO_Request();
request.apiName = 'API_GetCustomerInfo';
request.inputs = 'customerId=5678';
requests.add(request);
List<FLOW_CallApi.DTO_Response> responses = FLOW_CallApi.invokeApiCallSynchronously(requests);