Create Consultation
Overview
Endpoint allows you to create multiple types of consultations with a pre-selected appointment. You will receive such information as the price, its term and all the data needed for further processing of the consultation on the side of the operator which is Telemedi.
Create consultation
Request
const body = {
"specialization": "string", // "164b5f7f-b72e-4038-a67c-5308082734a9" -> Specialization ID for which we are scheduling an appointment.
"date": "string", // "2023-05-17T12:00:00.000Z" -> Consultation date
"channel": "number", // 2 -> Consultation channel
"patientName": "string", // "Beata"
"patientPesel": "string", // "51091845515"
"patientLastName": "string", // "Gruca"
"patientPhone": "string", // +48111222333
"patientEmail": "string",
"language": "string", // "pl" -> Allows defining the consultation language
"patientNationality": "string", // "PL"
"pozInterested": "number", // 0
"isInterestedInPoz": "number", // 0
"partialData": "boolean", // true
"username": "string", // "89027376"
"free": "number", // 0
"directContact": "boolean", // false
"currency": "string", // "PLN"
"detailedSource": "string", // "" -> Custom string allowing to define the origin of the consultation.
"reasons": []
}
fetch(`https://clinic.telemedi.co/api/v2/consultations`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
.then(response => response.json())
.then(response => console.log(response))
Response
{
"id": "UUID", // "42c29392-dfb5-49e7-9791-548bf5e00f32"
"created_at": "string", // 2023-05-17T13:39:30+02:00
"modified_at": "string", // 2023-05-17T13:39:32+02:00
"status": "consultation.status.reserved", // (traslated status_number label) "consultation.status.canceled_sms_late", "Anulowana (po czasie)"
// DO NOT USE "status" as enum for complex computations - use status_number instead
"type": "string", // "phone" - consultatione type
"doctorName": "string", // "Beata Gruca"
"doctorId": "UUID", // "14bbfac2-414a-45c3-b0f6-22eccf0c145e"
"doctorNameWithDegree": "string", // "prof. Beata Gruca"
"patientId": "UUID", // "42b6c0da-3a3e-4314-a5a4-c43d4e6ea65d"
"specialization": {
"id": "UUID", // "164b5f7f-b72e-4038-a67c-5308082734a9"
"created_at": "string", // "1900-01-01T00:00:00+01:24"
"modified_at": "string", // "2023-02-15T07:35:21+01:00"
"name": "string", // "Lekarz ogólny / internista"
"currency": "string" // "PLN"
},
"chatSession": "string", // standard chatSession "2_MX40NTgwNjEwMn5-MTY4NDMyMzU3MjA5N35EVWZrRXVDbFd6UCtQeEg1UEtuSGIwOG5-fn4"
"chatSession2": "string", // chatSession for safari browser "2_MX40NjI4NzQ5Mn5-MTY4NDMyMzU3MTg4MX5GRi9iSmxBMVNvTmRuRWUxQjhKakw2eG5-fn4"
"cost": "string", // "79"
"doctor_salary_price": "string", // "79"
"doctor_salary_paid_by_hour": null,
"doctor_salary_paid_by_hour_is_first": "boolean", // false
"is_payed": "boolean", // false
"visit_at": "string", // "2023-05-17T14:00:00+02:00"
"started_at": null,
"finished_at": null,
"language": "string", // "pl" - consultation language
"currency": "string", // "PLN"
"minichatDismiss": "number", // 1
"video_tested_at": null,
"is_interested_in_poz": "boolean", // false
"telemedico_poz": null,
"covid_case": null,
"manual_consultation": "boolean", // false
"first_patient_visit": "boolean", // false
"first_visit_modal_opened": "boolean", // false
"manual_prescription": "boolean", // true
"is_interested_in_telemedi_go": "boolean", // false
"patient_data_confirmed": "boolean", // false
"paymentLink": "string" // https://telemedico.localhost/en/payment/check/52a6a90a-d7da-11eb-8136-0242ac120007/eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE1Nzg1Nzc5MzEsInVzZXJuYW1lIjoidGVsZW1lZGljb19hZG1pbiIsInJvbGVzIjoiUk9MRV9TVVBFUl9BRE1JTixST0xFX0FDVElWRSIsImV4cCI6MTYxMDExMzkzMX0.eYv9CUXbLD1uhbRUV5rGjZZf5PrPsDjunshneq674dOM_u5XXDcpzzcDUzRwpZjuaBgugkvc3cHsajhOX2-3qEwCaQeeyjcfUtUJSTAhs_aEeqjskDAjVtyQBnkBy2IkCur2Uadz5hR4T4CvcDtJMCFgbj82OVVcAsGjM3DGHRTZln2iilkSSrWdVCSZs1UB7-H5lvRznI0mDJlW6ni61FEjm1fazKhMf0NOnssWLCW-zOHABTtrqYjJka9FQUMIXa2toNiMIZUR5tT6bdfm2UI8HLXQhDp111wrw3Tcjy3E6eYLZai0RftU6rZ0hLNFcBpwdro4GFykK1DWBsWbcXSH5Ch3jV3uvueQcwvt6x3mZKDGEvk4Q_tbsa5Rul0_DcemNGHZlkezsi4YxZUMWSPXvfEslBrMQyY4V-TqCf0utWIx4YHYGZu9tq_x2ywPR4V7a2kQzxXL7srXRDAG90t9QErk3fSJBSRXFTMX9CdME5qNG9TkUAJPtfiyszivVhhlvc1I7Uhqc2rumcI3zUSgo4_JsFCSi-r8v34s_MQCzs4gl6LWsr_2-aQ-LjgTYkv71FN8VPMU1dgQGnfmPC3_xIbIKdMQGOGaI6CTBo28F2XCk1IbMTCPBdY81G0_NErAI_lWqoxo2uox_x5FXEKKefalDMlFb73IxGMI0Vw
}
Cancel consultation
Request
const consultationId = 'your_consultation_id_here';
fetch(`https://clinic.telemedi.co/api/v2/consultations/${consultationId}/cancel`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
})
.then((r) => console.log(r))
Consultation term change
Request
const body = {
"checkAvailableSlots": true,
"startAt": "2020-09-12 12:00",
"endAt": "2020-09-12 12:10",
"doctorId": "f2d9eb96-aacf-4540-a907-e14f50f87791",
"timezone": "Europe/Warsaw",
"isMagicLinkFlow": true,
"channel": 1
};
const consultationId = 'your_consultation_id_here';
fetch(`https://clinic.telemedi.co/api/v2/consultations/${consultationId}/terms`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body
})
.then((r) => console.log(r))
Response
{
"status": true,
"message": "Success!"
}
Consultation file upload
Request
const consultationId = 'your_consultation_id_here';
let data = new FormData()
data.append('file', input.files[0])
fetch(`https://clinic.telemedi.co/api/v2/consultations/${consultationId}/upload`, {
method: 'POST',
body: data
})
.then(response => response.json())
.then(response => console.log(response))
Response
{
"id": "uuid",
"url": "string"
}
Apply consultation voucher
Request
const consultationId = 'your_consultation_id_here';
fetch(`https://clinic.telemedi.co/api/v2/consultations/${consultationId}/voucher/pay`, {{
"code": "123"
}})
.then((r) => console.log(r))
Response
{
"message": "consultation paid"
}
List consultations
Request
const params = {
status: 'planned', // planned, archived, all
startVisitAt: '2021-06-01T10:00:00',
endVisitAt: '2021-06-02T10:00:00',
sort: 'DESC', // DESC / ASC
lang: 'pl',
limit: 20,
page: 1
};
const paramsString = new URLSearchParams(params)
fetch(`https://clinic.telemedi.co/api/v2/consultations?${paramsString}`)
.then((r) => console.log(r))
Response
{
"items": {
"status": "string",
"type": "string",
"doctorName": "string",
"doctorId": "UUID",
"doctorNameWithDegree": "string",
"doctorRtptpn": "string",
"patientId": "UUID",
"id": "UUID",
"specialization": {
"id": "UUID",
"name": "string"
},
"chatSession": "string",
"chatSession2": "string",
"cost": "float",
"is_payed": "boolean",
"created_at": "datetime",
"visit_at": "datetime",
"started_at": "datetime",
"finished_at": "datetime",
"language": "string",
"directLink": "string",
"isPoz": "boolean",
"pozForm": "integer",
"drugNames": "array|null",
"stationaryVisitAddress": {
"city": "string",
"street": "string",
"houseNumber": "string",
"apartmentNumber": "string"
},
"consultationType": "integer",
"doctor": {
"avatar": "https://telemedico.localhost/assets/avatars/f2d9eb96-aacf-4540-a907-e14f50f87791.png"
}
},
"total": 100,
"count": 10,
"_links": {
"id": "UUID",
"self": "/api/v2/consultations?page=1",
"first": "/api/v2/consultations?page=1",
"next": "/api/v2/consultations?page=2",
"last": "/api/v2/consultations?page=10"
}
}