[#1271] Adding filter options on Get bookings list REST API call

Migrated from Redmine #1271 | Author: Alain Tamno
Status: New | Priority: High, I’m very impatient | Created: 2024-09-05


Hello,

We are facing a limitation of the APIs in REST API mode (API documentation | SimplyBook.me Online Scheduling). Indeed the number of parameters on which we can filter the list of reservations is very limited unlike other languages. What solution to be compatible with filtering for example by date_from and date_to as is possible for the PHP language (Company administration service methods - Company administration service methods - SimplyBook.me)?

Thanks

Redmine Admin wrote:

hi, not sure what you mean because API is irrelevant to programming language

Alain Tamno wrote:

Redmine Admin wrote:

hi, not sure what you mean because API is irrelevant to programming language

the problem is maybe me. We use a curl call and for that we go through a call that looks like this as taken from the documentation:

GET https://user-api-v2.simplybook.me/admin/bookings?filter[upcoming_only]=1

With the above call, we are limited in terms of parameters, for example “date_from” is not available.

But with your answer, I understand that if we use the URL https://api.simplybook.me/v2/getBookings from our script still with curl we can call the getBookings API and give it the available parameters?

Redmine Admin wrote:

what prevents you to add &date_from= to the request?

Alain Tamno wrote:

Redmine Admin wrote:

what prevents you to add &date_from= to the request?

When we add date_from to this GET https://user-api-v2.simplybook.me/admin/bookings?filter[date_from]=value it doesn’t work because this doesn’t know this parameter. Below and extract of the documentation as mention before :

Get bookings list
Return bookings list.
Please note that result is wrapped into paginated result.
Throws AccessDenied error in case user does not have access to bookings report.

In GET parameters you can pass page, on_page and filter with following parameters:
upcoming_only - return upcomming bookings only
status - booking status (can be confirmed/confirmed_pending/pending/canceled)
services - array of service ids to filter by services
providers - array of provider ids to filter by providers
client_id - client id. to filter by client id
date - filter by date
search - search string (by code, client data)
additional_fields - search by additional fields (&filter[additional_fields][field] = value)

Endpoint:
/admin/bookings

Method:
GET

Request parameters:
int page - page in list
int on_page - items per page
object filter - filter object

Return:
array|AdminReportBookingEntity
HTTP Request example:

Dmytro Bondarev wrote:

Hi, to use date_from you must pass date_to as well

https://user-api-v2.simplybook.me/admin/bookings?filter[date_from]=value&filter[date_to]=value

Alain Tamno wrote:

Dmytro Bondarev wrote:

Hi, to use date_from you must pass date_to as well

https://user-api-v2.simplybook.me/admin/bookings?filter[date_from]=value&filter[date_to]=value

sure, but it doesn’t work. We tried this

Alain Tamno wrote:

Alain Tamno wrote:

Dmytro Bondarev wrote:

Hi, to use date_from you must pass date_to as well

https://user-api-v2.simplybook.me/admin/bookings?filter[date_from]=value&filter[date_to]=value

sure, but it doesn’t work. We tried this

any news for this case ?

Dmytro Bondarev wrote:

Hi, please provide your request and result. You can omit sensitive data.