Estás integrando la API pública de Telepatia Synapse.
Endpoint: GET /v1/appointments
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Solicitud:
- startFrom [query]: string (opcional) — ISO-8601 lower bound on start (inclusive).
- startTo [query]: string (opcional) — ISO-8601 upper bound on start (inclusive).
- status [query]: array<AppointmentStatus> (opcional) — Filter by one or more statuses (repeatable).
- consultationInternalId [query]: string (opcional) — Filter to the booking that carries this consultation id.
- page [query]: integer (opcional, min=1) — Page number (1-based).
- limit [query]: integer (opcional, min=1, max=50) — Number of items per page.
Éxito 200:
- items: array<AppointmentResponse>
- total?: integer
- page: integer
- limit: integer
- totalPages?: integer
- hasMore: boolean
Errores (envoltorio: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 503: service_unavailable
Genera código en el lenguaje del archivo actual que:
1. Lea SYNAPSE_API_KEY desde el entorno (no lo escribas de forma fija).
2. Llame al endpoint con solicitud y respuesta tipadas.
3. Asigne el envoltorio de errores a excepciones tipadas por código de estado.
4. Agregue una prueba de flujo exitoso usando el token Bearer.