export type GetApiAgentphoneV1CallsCallIdArgs = {callId: string}; export type GetApiAgentphoneV1CallsCallIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get call details and transcript. Poll until status is completed or failed. * * GET /agentphone/v1/calls/{callId} */ export const getApiAgentphoneV1CallsCallId = async (args: GetApiAgentphoneV1CallsCallIdArgs, options?: GetApiAgentphoneV1CallsCallIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/agentphone/v1/calls/${encodeURIComponent(String(args.callId))}${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 };