export type SendNoteDto = {contact_name?: string | undefined, meta_data: {[key: string]: unknown}, stage_id?: string | undefined, to_phone: string, from_phone: string, note: string, agent_id?: string | undefined}; export type CreateApiApiPublicWhatsappMessageNoteSendArgs = {'x-api-key': string, body: SendNoteDto}; export type CreateApiApiPublicWhatsappMessageNoteSendOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send a note message * * POST /api/public/whatsapp/message/note/send */ export const createApiApiPublicWhatsappMessageNoteSend = async (args: CreateApiApiPublicWhatsappMessageNoteSendArgs, options?: CreateApiApiPublicWhatsappMessageNoteSendOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/whatsapp/message/note/send${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };