@squidcloud/client
    Preparing search index...

    Class ApiClient

    ApiClient facilitates making HTTP API requests to external integrations, supporting various HTTP methods such as GET, POST, PUT, PATCH, and DELETE.

    Index

    Methods

    • Sends a DELETE request to the specified integration endpoint.

      Type Parameters

      • ResponseBodyType = unknown
      • RequestBodyType = unknown

      Parameters

      • integrationId: string

        The integration to send the request to.

      • endpointId: string

        The API endpoint to call.

      • Optionalbody: RequestBodyType

        Optional request body to send.

      • Optionaloptions: ApiOptions

        Optional API request options (headers, query params, etc).

      Returns Promise<HttpResponse<ResponseBodyType>>

      A promise resolving to the HTTP response.

    • Sends a GET request to the specified integration endpoint.

      Type Parameters

      • ResponseBodyType = unknown

      Parameters

      • integrationId: string

        The integration to send the request to.

      • endpointId: string

        The API endpoint to call.

      • Optionaloptions: ApiOptions

        Optional API request options (headers, query params, etc).

      Returns Promise<HttpResponse<ResponseBodyType>>

      A promise resolving to the HTTP response.

    • Sends a PATCH request to the specified integration endpoint.

      Type Parameters

      • ResponseBodyType = unknown
      • RequestBodyType = unknown

      Parameters

      • integrationId: string

        The integration to send the request to.

      • endpointId: string

        The API endpoint to call.

      • Optionalbody: RequestBodyType

        Optional request body to send.

      • Optionaloptions: ApiOptions

        Optional API request options (headers, query params, etc).

      Returns Promise<HttpResponse<ResponseBodyType>>

      A promise resolving to the HTTP response.

    post

    • post<ResponseBodyType = unknown, RequestBodyType = unknown>(
          integrationId: string,
          endpointId: string,
          body?: RequestBodyType,
          options?: ApiOptions,
      ): Promise<HttpResponse<ResponseBodyType>>

      Sends a POST request to the specified integration endpoint.

      Type Parameters

      • ResponseBodyType = unknown
      • RequestBodyType = unknown

      Parameters

      • integrationId: string

        The integration to send the request to.

      • endpointId: string

        The API endpoint to call.

      • Optionalbody: RequestBodyType

        Optional request body to send.

      • Optionaloptions: ApiOptions

        Optional API request options (headers, query params, etc).

      Returns Promise<HttpResponse<ResponseBodyType>>

      A promise resolving to the HTTP response.

    • Sends a PUT request to the specified integration endpoint.

      Type Parameters

      • ResponseBodyType = unknown
      • RequestBodyType = unknown

      Parameters

      • integrationId: string

        The integration to send the request to.

      • endpointId: string

        The API endpoint to call.

      • Optionalbody: RequestBodyType

        Optional request body to send.

      • Optionaloptions: ApiOptions

        Optional API request options (headers, query params, etc).

      Returns Promise<HttpResponse<ResponseBodyType>>

      A promise resolving to the HTTP response.