export type GetApiAgentphoneV1AgentsAgentIdWebhookArgs = {agentId: string}; export type GetApiAgentphoneV1AgentsAgentIdWebhookOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get webhook URL for a specific agent. * * GET /agentphone/v1/agents/{agentId}/webhook */ export const getApiAgentphoneV1AgentsAgentIdWebhook = async (args: GetApiAgentphoneV1AgentsAgentIdWebhookArgs, options?: GetApiAgentphoneV1AgentsAgentIdWebhookOptions) => { 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/agents/${encodeURIComponent(String(args.agentId))}/webhook${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 };