export type GetApiVerifyV1EmailBulkResultsRequestIdDownloadArgs = {requestId: string}; export type GetApiVerifyV1EmailBulkResultsRequestIdDownloadOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download bulk verification results * * GET /verify/v1/email/bulk/results/{requestId}/download */ export const getApiVerifyV1EmailBulkResultsRequestIdDownload = async (args: GetApiVerifyV1EmailBulkResultsRequestIdDownloadArgs, options?: GetApiVerifyV1EmailBulkResultsRequestIdDownloadOptions) => { const {baseUrl = "https://api.customeros.ai", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/csv") if (ApiKeyAuth !== undefined) headers.set("X-CUSTOMER-OS-API-KEY", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/verify/v1/email/bulk/results/${encodeURIComponent(String(args.requestId))}/download${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.text() };