Sinch Node.js SDK - v1.5.0
    Preparing search index...

    Class ApiFetchClient

    Client to process the call to the API using Fetch API

    Index

    Constructors

    • Initialize your API Client instance with the provided configuration options. Default request plugins: VersionRequest Default response plugins: ExceptionResponse

      Parameters

      • options: ApiClientOptions

        Configuration options for the API Client.

      Returns ApiFetchClient

    Properties

    apiClientOptions: ApiClientOptions

    Methods

    • Returns a map containing the query parameters based on the provided data and names.

      Type Parameters

      • T extends { [key: string]: any }

      Parameters

      • data: T

        The data object from which to extract query parameters.

      • names: (keyof T)[]

        An array of keys (property names) to extract from the data object.

      Returns { [p in string | number | symbol]: string }

      A map containing the extracted query parameters.

    • Asynchronously prepares options for an HTTP request.

      Parameters

      • url: string

        The URL for the HTTP request.

      • method: string

        The HTTP method for the request (e.g., 'GET', 'POST').

      • queryParams: { [key: string]: string }

        An object representing query parameters.

      • headers: { [key: string]: string }

        An object representing headers.

      • Optionalbody: RequestBody

        The request body, if applicable.

      • Optionalpath: string

        An optional path for the request.

      Returns Promise<RequestOptions>

      A promise that resolves to the prepared options for the HTTP request.

    • Prepares the url to be called by appending query parameters.

      Parameters

      • url: string

        The base url to be used.

      • OptionalqueryParameters: { [key: string]: string }

        Key-value pair with the parameters. If the value is undefined, the key is dropped.

      • OptionalrepeatParamArray: boolean

        create as many single parameters with each value of the array

      Returns string

      The prepared URL as a string.

    • Type Parameters

      • T

      Parameters

      • apiCallParameters: ApiCallParameters

      Returns Promise<T>

    • Type Parameters

      • T

      Parameters

      • apiCallParameters: ApiCallParametersWithPagination

      Returns Promise<PageResult<T>>

    • Parameters

      • apiCallParameters: ApiCallParameters

      Returns Promise<FileData>

    • Parameters

      • apiCallParameters: ApiCallParameters

      Returns Promise<FileBuffer>