bothy-sdk
    Preparing search index...

    Function respond

    • Answers an interaction of an own card (respondToInteraction).

      From received or dispatched the server stores the state and the response; the same final state again answers the current interaction; every other transition is 409 invalid_state_transition (09 11.4). No event follows: the card shows the result through update.

      Parameters

      • api: InteractionClient

        An openapi-fetch client of the public API (for example createApiClient).

      • interactionId: string

        The interaction of interaction.created.

      • state: "rejected" | "failed" | "acknowledged"

        acknowledged, failed or rejected.

      • options: RespondOptions = {}

        The response text and the Idempotency-Key.

      Returns Promise<{}>

      The interaction as the server stored it.

      RangeError before sending for a state outside RESPOND_STATES or a text that is not a string; ProblemError when the server refuses.

      await respond(api, interactionId, "acknowledged", { text: "Refund approved" });