export type GetApiV21AccountsAccountIdTemplatesTemplateIdHtmlDefinitionsArgs = {accountId: string, templateId: string}; export type GetApiV21AccountsAccountIdTemplatesTemplateIdHtmlDefinitionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the Original HTML Definition used to generate the Responsive HTML for the template. * * GET /v2.1/accounts/{accountId}/templates/{templateId}/html_definitions */ export const getApiV21AccountsAccountIdTemplatesTemplateIdHtmlDefinitions = async (args: GetApiV21AccountsAccountIdTemplatesTemplateIdHtmlDefinitionsArgs, options?: GetApiV21AccountsAccountIdTemplatesTemplateIdHtmlDefinitionsOptions) => { 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))}/templates/${encodeURIComponent(String(args.templateId))}/html_definitions${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() };