export type GetApiOlostepV1AnswersAnswerIdArgs = {answer_id: string}; export type GetApiOlostepV1AnswersAnswerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * This endpoint retrieves a previously completed answer by its ID. * * GET /olostep/v1/answers/{answer_id} */ export const getApiOlostepV1AnswersAnswerId = async (args: GetApiOlostepV1AnswersAnswerIdArgs, options?: GetApiOlostepV1AnswersAnswerIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/olostep/v1/answers/${encodeURIComponent(String(args.answer_id))}${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 };