Skip to main content

Get Terms

Overview

The section describes the functionality of downloading available terms for a given specialty. Endpoint allows you to filter the available terms using the filters and parameters described below.

Request

const specializationId: string = '3b83362c-c426-437b-b3c4-86974b0679a9'; // required - specialization id
const start: string = '2023-05-17'; // required - This is the date from which the appointments are to be searched. By default, it is today's date.
const days: string = '14'; // required - Number of days from the date.

const params = {
channel: '1', // optional parameter -> you can filter the terms assuming that the patient wants to use a specific communication channel
age: null, // optional parameter -> patient age
language: 'pl', // optional parameter -> Allows to set the language of retrieved terms
doctorId: '3362c3b8-c426-437b-b3c4-4b0679a98697', // optional parameter -> doctor id
timezone: 'Europe/Warsaw', // optional parameter -> timezone
limit: "200", // optional parameter -> allows limiting the retrieved terms.
showFreePozTerms: "0", // optional parameter -> If set to 1, it means that only POZ terms will be fetched.
allowConsultationOnlyFromSpecialists: false, // optional parameter -> Returns only terms for doctors from the "specialists" tab.
};

const paramsString = new URLSearchParams(params)

fetch(`https://clinic.telemedi.co/api/v2/terms/${specializationId}/${start}/${days}?${paramsString}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
.then(response => response.json())
.then(response => console.log(response))

Response

[
{
"start": "2023-05-11T10:00:00+02:00",
"end": "2023-05-11T12:00:00+02:00",
"doctors": [
"bc1a5c39-16f3-48fd-a9f3-0c5a4564fe56"
],
"channels": [
1,
2,
3
],
"doctorsForSlot": [
{
"doctor_name_with_degree": "lek. Beata Gruca",
"doctor_id": "bc1a5c39-16f3-48fd-a9f3-0c5a4564fe56",
"grade": 0,
"price": "20",
"ratings_count": 0,
"avatar": null,
"channels": [
1,
2,
3
],
"allow_consultation_only_from_specialists": false,
"instant_chat_enabled": false
}
]
}
]