export type GetApiRecallZoomAccessTokenArgs = {user_id: string, auth_token: string}; export type GetApiRecallZoomAccessTokenOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /recall/zoom_access_token */ export const getApiRecallZoomAccessToken = async (args: GetApiRecallZoomAccessTokenArgs, options?: GetApiRecallZoomAccessTokenOptions) => { const {baseUrl = "http://api.attention.tech", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args.user_id != null) query.append("user_id", String(args.user_id)) if (args.auth_token != null) query.append("auth_token", String(args.auth_token)) const url = `${baseUrl.replace(/\/+$/, '')}/recall/zoom_access_token${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() };