export type GetApiApiV1ChatAttendeesIdPictureArgs = {id: string}; export type GetApiApiV1ChatAttendeesIdPictureOptions = {baseUrl?: string | undefined, AccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download a chat attendee picture * * GET /api/v1/chat_attendees/{id}/picture */ export const getApiApiV1ChatAttendeesIdPicture = async (args: GetApiApiV1ChatAttendeesIdPictureArgs, options?: GetApiApiV1ChatAttendeesIdPictureOptions) => { const {baseUrl = "https://api1.unipile.com:13111", fetch: fetchFn = fetch, AccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AccessToken !== undefined) headers.set("X-API-KEY", AccessToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/chat_attendees/${encodeURIComponent(String(args.id))}/picture${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 undefined };