callApi<T> method

Future<T> callApi<T>(
  1. ApiEndpointId apiEndpointId, {
  2. required IntegrationId integrationId,
  3. Map<String, dynamic> request = const {},
})

Invokes the HTTP API (defined by the given integrationId and apiEndpointId) with the given request parameters and returns a future with the response. The structure of the request and the response is defined in the integration's schema page.

For more information about API integrations in Squid, please refer to the documentation.

Implementation

Future<T> callApi<T>(ApiEndpointId apiEndpointId,
    {required IntegrationId integrationId,
    Map<String, dynamic> request = const {}}) {
  _validateNotDestructed();
  return _apiManager
      .callApiAndSubscribe<T>(integrationId, apiEndpointId, request)
      .toFuture();
}