export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdCustomFieldsArgs = {accountId: string, envelopeId: string}; export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdCustomFieldsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the custom field information for the specified envelope. * * GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/custom_fields */ export const getApiV21AccountsAccountIdEnvelopesEnvelopeIdCustomFields = async (args: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdCustomFieldsArgs, options?: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdCustomFieldsOptions) => { 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))}/custom_fields${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() };