export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdDocumentsDocumentIdTabsArgs = {accountId: string, documentId: string, envelopeId: string, include_metadata?: string | undefined, page_numbers?: string | undefined}; export type GetApiV21AccountsAccountIdEnvelopesEnvelopeIdDocumentsDocumentIdTabsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns the tabs on a document. * * GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/tabs */ export const getApiV21AccountsAccountIdEnvelopesEnvelopeIdDocumentsDocumentIdTabs = async (args: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdDocumentsDocumentIdTabsArgs, options?: GetApiV21AccountsAccountIdEnvelopesEnvelopeIdDocumentsDocumentIdTabsOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.include_metadata != null) query.append("include_metadata", String(args.include_metadata)) if (args.page_numbers != null) query.append("page_numbers", String(args.page_numbers)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/envelopes/${encodeURIComponent(String(args.envelopeId))}/documents/${encodeURIComponent(String(args.documentId))}/tabs${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() };