Table of contents 
How integration works 
The main way is to search for a service through the unified directory of the MedRoket platform: you find a service according to a general classifier, get specific branches and internal identifiers of the service and the doctor, and then use them in the schedule and records.
Identifiers are unique only within their own entity type. The same numeric id value in the unified directory and the service id in a specific branch are different entities.
API Methods 
Reference books 
- Get a list of cities GET /models/town/ — cities filtered by your country. Integration entry point: from here you take the town_id to search for services.
- To get a list of regions, GET /models/region/.
- Get a list of available branches of GET /models/lpu/ — with filters by city, specialty, availability of prices and other criteria.
- To get a list of available branch groups, GET /models/lpu_group/.
- Get a list of city districts GET /models/district/, a list of metro stations GET /models/metro/ and a list of metro lines GET /models/metro_line/ — for geo-filters when searching for branches.
- To get a list of specialties, GET /models/speciality/.
- To get a list of doctors with a schedule, GET /models/doctor/ is a directory of doctors with a unified model.
Search for services 
- Get a list of services GET /uni/services/ — services in a unified directory with categories. The response is cached for 24 hours; the availability of the service in the directory does not guarantee that there are free slots for it right now.
- Get a list of branches providing the service GET /uni/services/{uni_service_id}/lpus/ — branches in the city where this service and available slots are available. In the response, you get a specific orig_service_id for the next step.
Schedule 
- Get the POST /schedule/services/ schedule — free slots for specific services and branches for the next 30 days.
The original reference book from the IIA 
MIS is the clinic's medical information system.
- To get a list of doctors, GET /orig/doctors/ — doctors of branches from the IIA, with a matching identifier in the unified directory.
Recording, cancellation, and History 
- Create an online account for the POST /direct_appointment/service/execute/ service.
- Cancel an online appointment for the POST /direct_appointment/service/cancel/ service.
- Get the history of online records GET /direct_appointment/history/ — records for the last 45 days made through your token.
Business cases 
Important: there are no services in the directories that require prior medical advice. Online records for such services are not available.
Case 1. There is no understanding in which branch to look for the right service 
This is the basic scenario: you guide the patient according to the general catalog of services, and not according to the price list of a particular clinic.
- To get a list of cities, request
town_id
the desired city . - Use the Get a list of services method to request the required service in the unified directory (we recommend caching this data on your side and updating it once a day)
- In the request for the Get a list of branches providing the service, specify the previously received ones.
uni_service_id
andtown_id
to request branches where the service is available for recording. In response, you will receivelpu_id
andorig_service_id
. - To get a schedule of services, specify the available slots and, if necessary, a specific doctor.
- Using the Create Online Service Entry method, create an entry by passing the selected
lpu_id
,orig_service_id
, patient's time and data.
Case 2. The branch and the service are already known 
If lpu_id
and orig_service_id
you already have — for example, saved from the last request — steps 1-3 from the first scenario can be skipped and immediately go to the schedule and recording.:
- To get a schedule of services, specify the available slots and, if necessary, a specific doctor.
- Using the Create Online Service Entry method, create an entry by passing the selected
lpu_id
,orig_service_id
, patient's time and data.
Case 3. You need to cancel the recording 
- If
uuid
If the record is saved, then you can immediately make a request using the Cancel Online service entry method. - If
uuid
there is no record — find the record using the Get Online Record History method by filtering by patient's phone number and/or date range.
Frequent questions 
How do I get a token to access the API?
A token for the development and testing of integration will be sent by the MedRoket Partner Relations Manager upon your request. For the development and testing of this token, only the data of the test clinic will be available. At the end of development, your main token for HP will be switched and it will be possible to create both doctor's appointments and a service with it.
Is it necessary to specify a doctor when making an appointment?
No. If you do not specify a doctor, the clinic will appoint one on its own.
Is it possible to get a directory of services once and not request it every time a patient visits?
Yes, we recommend caching for 24 hours. At the same time, the availability of specific slots must be checked separately: the presence of a service in the directory does not mean that there are free slots for recording.
What does the 30-day limit mean in the service schedule?
A single schedule request cannot cover a period further than 30 days from the current date.
The request to create a record has been left unanswered — is it safe to repeat it?
Before repeating the request, check the patient's phone record history: if an entry has already been created, resending it may result in an error or an unnecessary entry.
Is every API request charged?
No, only each successful record creation request is charged, according to the terms of your agreement.
The desired city is not in the directory of cities — what should I do?
The directory is filtered by your country. If you don't have enough cities, contact the MedRoket Partner Relations Manager.