Online booking API v.1.4: Difference between revisions
Alpaca wiki (talk | contribs) No edit summary |
Alpaca wiki (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 58: | Line 58: | ||
'''Sample response''' | '''Sample response''' | ||
< | <syntaxhighlight lang="json"> | ||
{ | { | ||
"ok": true, | "ok": true, | ||
| Line 132: | Line 132: | ||
] | ] | ||
} | } | ||
</ | </syntaxhighlight> | ||
Latest revision as of 17:32, 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
<syntaxhighlight lang="json"> {
"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": ""
}
},
} ] } ]
} </syntaxhighlight>