export type GetApiV21AccountsAccountIdConnectFailuresArgs = {accountId: string, from_date?: string | undefined, to_date?: string | undefined}; export type GetApiV21AccountsAccountIdConnectFailuresOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the Connect failure log information. * * GET /v2.1/accounts/{accountId}/connect/failures */ export const getApiV21AccountsAccountIdConnectFailures = async (args: GetApiV21AccountsAccountIdConnectFailuresArgs, options?: GetApiV21AccountsAccountIdConnectFailuresOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.from_date != null) query.append("from_date", String(args.from_date)) if (args.to_date != null) query.append("to_date", String(args.to_date)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/connect/failures${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() };