Online booking API v.1.4: Difference between revisions

From Alpaca Medical Manuals
Created page with "-Back to API and integrations =General description= API is a set of methods for receiving information and transmitting information to Alpaca ERP. API allows you to get information about doctors who have online appointments, their working hours, available slots for appointments, and also to register a patient in an available slot. Interaction with the API is carried out via the HTTP1.1 protocol and GET and POST requests. ==Authentication== The following data must..."
 
No edit summary
Line 4: Line 4:


API is a set of methods for receiving information and transmitting information to Alpaca ERP.
API is a set of methods for receiving information and transmitting information to Alpaca ERP.
API allows you to get information about doctors who have online appointments, their working hours, available slots for appointments, and also to register a patient in an available slot.
API allows you to get information about doctors who have online appointments, their working hours, available slots for appointments, and also to register a patient in an available slot.
Interaction with the API is carried out via the HTTP1.1 protocol and GET
Interaction with the API is carried out via the HTTP1.1 protocol and GET
Line 14: Line 15:
Authorization Bearer <token>
Authorization Bearer <token>
token - the token value taken from the ERP user profile on whose behalf the API requests will be made.
token - the token value taken from the ERP user profile on whose behalf the API requests will be made.
Also, the following headers must be transmitted:
Also, the following headers must be transmitted:
Accept: application/json
Accept: application/json
Content-Type: application/json
Content-Type: application/json
API always responds with JSON objects.
API always responds with JSON objects.
If the operation is successful, the response always contains {ok: true}, in addition to other
If the operation is successful, the response always contains {ok: true}, in addition to other
information.
information.
If an error occurred during execution - {ok: false, error: <description>}
If an error occurred during execution - {ok: false, error: <description>}
<description> - error description
<description> - error description

Revision as of 17:28, 23 September 2024

-Back to API and integrations

General description

API is a set of methods for receiving information and transmitting information to Alpaca ERP.

API allows you to get information about doctors who have online appointments, their working hours, available slots for appointments, and also to register a patient in an available slot. Interaction with the API is carried out via the HTTP1.1 protocol and GET and POST requests.

Authentication

The following data must be transmitted in the request headers

Authorization Bearer <token> token - the token value taken from the ERP user profile on whose behalf the API requests will be made.

Also, the following headers must be transmitted:

Accept: application/json

Content-Type: application/json

API always responds with JSON objects.

If the operation is successful, the response always contains {ok: true}, in addition to other information.

If an error occurred during execution - {ok: false, error: <description>} <description> - error description

Setting up Alpaca ERP

To work with this API, you need to configure the following settings for Alpaca ERP:

1. In the settings, in the "Online scheduling settings" section, enable "Online scheduling Enabled" and specify "Slot depth" (the number of days to upload from the current one) 2. In the Employees directory, for employees whose schedule should be uploaded to the API, set the "To site" flag in the Services section on the services that will be uploaded to the site. 3. In the Employees directory, for employees whose schedule should be uploaded to the API, set the "Online booking" flag in the Services section on the services that will be used for online booking. Setting this flag is only available for services with the "To site" flag. 4. In the Employees directory, employees whose schedule should be uploaded to the API, in the services table, you need to select one service from those marked with the "Online booking" flag which will be the default service, for this you need to set the "Default" flag. The default service is always one. 5. In the "Touch types" directory, set the "Online booking" flag for the Touch type, which will be set upon recording.

Methods

1. GET <alpaca url>/api/schedule/employees - getting a list of doctors available for online booking

The method returns the employees object, containing information about doctors available for online booking and their services available for uploading to the site. The online_booking flag in the service indicates the availability of the service for online booking.

Sample response

{

"ok": true,
"employees": [
{
"id": 7,
"title": "Dr. Vitaly Finkelshtein",

מומחהn\.נוירולוג מומחה וסגן מנהל מחלקה נוירולוגית במרכז הרפואי וולפסון" :"description " ,"למחלות עצב-שריר, כאבי ראש, מגרנות, בדיקות אי אמ ג'י ומחלות נוירולוגיות אחרות

"cfr": «Neurology",

"locales": {

"title": {
"en": "Dr. Vitaly Finkelshtein",
"he": ""
}
},
"organisation": "Tel Aviv Medical Center - TAMC LTD",
"position": null,
"services": [
{
"title": "Neurologist consultation",
"id": 30,
"duration": 60,
"online_booking": false,
"is_default": true,
"locales": {
"title": {
"en": "Neurologist consultation",
"he": ""
},
"description": {
"en": "",
"he": ""
}
},
}
]
},
{
"id": 75,
"title": "Test employee",
"description": "Doc test",
"cfr": null,

"locales": {

"title": {
"en": "Test employee",
"he": ""
}
},
"organisation": "Tel Aviv Medical Center - TAMC LTD",
"position": null,
"services": [
{
"title": "CBC+Chemistry+electrolytes",
"id": 270,
"duration": null,
"online_booking": false,
"is_default": false,
"locales": {
"title": {
"en": "CBC+Chemistry+electrolytes",
"he": ""
},
"description": {
"en": "",
"he": ""
}
},
}
]
}
]

}