The external API interface gives access to trigger the configured and available external API's.

Hierarchy

  • ExternalApi

Methods

  • Entry point for the external API

    Type Parameters

    • T

    Parameters

    • obj: ExternalApiData

      The configuration object for the request. Used by the other helpers, but available to use directly giving the most flexibility.

    • callback: ((result) => void)

      The callback function to call when the request is finished and the response is available.

        • (result): void
        • Parameters

          • result: T

          Returns void

    Returns void

  • Helper to perform a get request to the external API. Allows to simply set the query parameters as a record of key value pairs.

    Type Parameters

    • T

    Parameters

    • source: string

      The name of the external api source.

    • action: string

      The name of the external api action.

    • query: Record<string, string>

      The query parameters to use.

    • callback: ((result) => void)

      The callback function to call when the request is finished and the response is available.

        • (result): void
        • Parameters

          • result: T

          Returns void

    Returns void

  • Helper to perform a post request to the external API via a form post. Allows to pass in the form dictionary which will be used for the body of hte request.

    Type Parameters

    • T

    Parameters

    • source: string

      The name of the external api source.

    • action: string

      The name of the external api action.

    • body: Record<string, string>

      The body as a form dictionary.

    • callback: ((result) => void)

      The callback function to call when the request is finished and the response is available.

        • (result): void
        • Parameters

          • result: T

          Returns void

    Returns void

  • Helper to perform a post request in JSON format to the external API. Allows to pass in the body as a dictionary which will be serialized to JSON.

    Type Parameters

    • T

    Parameters

    • source: string

      The name of the external api source.

    • action: string

      The name of the external api action.

    • body: Record<string, string>

      The body as a dictionary - which will be serialized to JSON.

    • callback: ((result) => void)

      The callback function to call when the request is finished and the response is available.

        • (result): void
        • Parameters

          • result: T

          Returns void

    Returns void

  • Heler to perform a post request in raw format to the external API. The data has to be seriaized already.

    Type Parameters

    • T

    Parameters

    • source: string

      The name of the external api source.

    • action: string

      The name of the external api action.

    • body: string

      The body to send.

    • callback: ((result) => void)

      The callback function to call when the request is finished and the response is available.

        • (result): void
        • Parameters

          • result: T

          Returns void

    Returns void

Generated using TypeDoc