export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdFormDataArgs = {accountId: string, envelopeId: string}; export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdFormDataOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns envelope tab data for an existing envelope. * * GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/form_data */ export const getApiV21AccountsAccountIdEnvelopesEnvelopeIdFormData = async (args: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdFormDataArgs, options?: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdFormDataOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/envelopes/${encodeURIComponent(String(args.envelopeId))}/form_data${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };