alextselegidis / easyappointments

:date: Easy!Appointments - Self Hosted Appointment Scheduler
https://easyappointments.org
GNU General Public License v3.0
3.25k stars 1.24k forks source link

1.5.0 API issues #1562

Open DumahBrazorf opened 1 month ago

DumahBrazorf commented 1 month ago

I just get 404 pages when trying to get categories list with API. Also, the API documentation for 1.5.0 may need corrections. I see "categoryId" in the services response but 1.5.0 now respond "serviceCategoryId". This is also a pity having to use different words in my program code for different API versions. Providers API call returns a php error before response. (json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in models/Providers_model.php line 892) and also a warning (Cannot modify header information - headers already sent by (output started at /var/www/html/system/core/Exceptions.php:283) in core/Common.php line 574)

It would be very useful if you add the ea_appointments.update_date_time field in the API appointments response, so we can see whenever someone modified the appointment. And with this addition, the possibility to get appointments list created/edited since a defined datetime, so we don't need to get the full list every time to check for modifications.

Thanks.

alextselegidis commented 1 month ago

Hello!

Which documentation page are you using for while developing your client?

For now please check this config file for an accurate description of the API

https://github.com/alextselegidis/easyappointments/blob/main/openapi.yml

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

DumahBrazorf commented 1 month ago

Hi, the api docs on your main site. https://easyappointments.org/docs.html#1.5.0/rest-api.md Calling service_categories returns 404 too.

alextselegidis commented 1 month ago

Hello!

That had to do with some late refactoring I had done before the 1.5 release.

The docs will be updated but instead of categories use service_categories for your requests and things will work out right.

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

alextselegidis commented 1 month ago

Docs were updated

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

alextselegidis commented 1 month ago

Re-open to check the other issues

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!

DumahBrazorf commented 1 month ago

service_categories does not work either, it returns the "404 Page Not Found | Easy!Appointments" html page I have a couple of categories added via backend page. all the others api calls work, except the providers issue.

EagleDelux commented 1 month ago

@alextselegidis

https://github.com/alextselegidis/easyappointments/blob/e45fcf30b579a9a2a03bbbb35efb96556f1ad426/application/config/routes.php#L131

this needs to be changed to route_api_resource($route, 'Service_categories', 'api/v1/');

alextselegidis commented 1 month ago

Good catch @EagleDelux, just updated this

Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!