POST
/transactional-api/appointment/create-booking-linkCreate Appointment Booking Link
Generates a public URL for self-service appointment booking. Provide either requiredProcedures (SNOMED CT coded) or both appointmentServiceId and appointmentTypeId, but not both; see Get Appointment Metadata for the available services, types and procedures.
Authorization: Bearer token (JWT). See Authentication.
Request
curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/appointment/create-booking-link' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"appointmentServiceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"appointmentTypeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"requiredProcedures": [
{
"conceptId": "string",
"description": "string"
}
],
"predefinedReasonForAppointment": "string"
}'
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
patientId | string<uuid> | Yes | Medicus patient identifier. |
appointmentServiceId | string<uuid> (nullable) | No | Must be provided together with appointmentTypeId. Mutually exclusive with requiredProcedures. |
appointmentTypeId | string<uuid> (nullable) | No | Must be provided together with appointmentServiceId. Mutually exclusive with requiredProcedures. |
requiredProcedures | array<object> (nullable) | No | SNOMED CT coded procedures the booked appointment type must support. Mutually exclusive with appointmentServiceId/appointmentTypeId. |
predefinedReasonForAppointment | string (nullable) | No | Reason for appointment to pre-fill on the booking link. |
Responses
200 Booking link created.
{
"url": "string"
}
400 Validation error.
8 possible code values
| Code | Description | When |
|---|---|---|
invalid-patient-id | The patientId is not a UUID | patientId missing or not a UUID |
patient-not-found | Patient not found for this patientId | patientId doesn't exist |
invalid-request | Provide either requiredProcedures or both appointmentServiceId and appointmentTypeId | invalid/missing combination of requiredProcedures, appointmentServiceId and appointmentTypeId |
invalid-appointment-service-id | The appointmentServiceId is not a valid UUID | appointmentServiceId not a valid UUID |
invalid-appointment-type-id | The appointmentTypeId is not a valid UUID | appointmentTypeId not a valid UUID |
appointment-service-not-found | Appointment service not found for this appointmentServiceId | appointmentServiceId doesn't exist |
appointment-type-not-found | Appointment type not found on this service | appointmentTypeId doesn't exist on the service |
invalid-procedure | Each entry in requiredProcedures must have a non-empty conceptId | a requiredProcedures entry has an empty or unresolvable conceptId |
{
"errors": [
{
"code": "invalid-patient-id",
"description": "The patientId is not a UUID"
}
]
}