[#777] unable to fetch Rang Bookings - Please advise

Migrated from Redmine #777 | Author: Rahim Ali
Status: Feedback | Priority: High, I’m very impatient | Created: 2021-09-06


Support,

I am using following request to pull one year user appointments till current date but i am getting future date appointments as well. Any idea what i am missing here

Request : GET https://user-api-v2.simplybook.plus/admin/bookings?filter[search]=rahim.ali%40mrm.com&date_from=2020-09-06&date_to=2021-09-06&on_page=2&page=1)

Response:
{
“data”: [
{
“provider”: {
“id”: 1,
“name”: “Turkey Creek”,
“qty”: 1,
“email”: “001tc@altardstate.com”,
“description”: “

101

”,
“phone”: “”,
“picture”: null,
“picture_preview”: null,
“color”: null,
“is_active”: true,
“is_visible”: true
},
“service”: {
“id”: 2,
“name”: “In Store Styling Appointment”,
“description”: “<p class="MsoNormal">Spend 30 minutes one-on-one with an Altar’d State personal\nstylist! Whether shopping for a big event or your seasonal wardrobe update, our\nstylists are happy to help choose the right look for you.

”,
“price”: null,
“currency”: null,
“tax_id”: null,
“tax”: null,
“duration”: 30,
“buffer_time_after”: 30,
“recurring_settings”: null,
“picture”: null,
“picture_preview”: null,
“memberships”: ,
“is_active”: true,
“is_visible”: true,
“duration_type”: null
},
“client”: {
“can_be_edited”: true,
“id”: 24,
“name”: “Rahim”,
“email”: “rahim.ali@mrm.com”,
“phone”: “+16097511111”,
“address1”: null,
“address2”: null,
“city”: null,
“zip”: null,
“country_id”: “US”,
“state_id”: null,
“full_address”: “US”
},
“status”: “canceled”,
“membership_id”: null,
“invoice_id”: null,
“invoice_status”: null,
“invoice_payment_received”: false,
“invoice_number”: null,
“invoice_datetime”: null,
“invoice_payment_processor”: null,
“ticket_code”: null,
“ticket_validation_datetime”: null,
“ticket_is_used”: null,
“testing_status”: null,
“user_status_id”: null,
“category_id”: null,
“location_id”: null,
“category”: null,
“location”: null,
“can_be_edited”: false,
“can_be_canceled”: false,
“id”: 49,
“code”: “0081cg3f”,
“start_datetime”: “2021-09-11 17:00:00”,
“end_datetime”: “2021-09-11 18:00:00”,
“service_id”: 2,
“provider_id”: 1,
“client_id”: 24,
“duration”: 60
},
{
“provider”: {
“id”: 3,
“name”: “Friendly Center”,
“qty”: 1,
“email”: “012gb@altardstate.com”,
“description”: “112”,
“phone”: “”,
“picture”: null,
“picture_preview”: null,
“color”: null,
“is_active”: true,
“is_visible”: true
},
“service”: {
“id”: 2,
“name”: “In Store Styling Appointment”,
“description”: “<p class="MsoNormal">Spend 30 minutes one-on-one with an Altar’d State personal\nstylist! Whether shopping for a big event or your seasonal wardrobe update, our\nstylists are happy to help choose the right look for you.

”,
“price”: null,
“currency”: null,
“tax_id”: null,
“tax”: null,
“duration”: 30,
“buffer_time_after”: 30,
“recurring_settings”: null,
“picture”: null,
“picture_preview”: null,
“memberships”: ,
“is_active”: true,
“is_visible”: true,
“duration_type”: null
},
“client”: {
“can_be_edited”: true,
“id”: 24,
“name”: “Rahim”,
“email”: “rahim.ali@mrm.com”,
“phone”: “+16097511111”,
“address1”: null,
“address2”: null,
“city”: null,
“zip”: null,
“country_id”: “US”,
“state_id”: null,
“full_address”: “US”
},
“status”: “confirmed”,
“membership_id”: null,
“invoice_id”: null,
“invoice_status”: null,
“invoice_payment_received”: false,
“invoice_number”: null,
“invoice_datetime”: null,
“invoice_payment_processor”: null,
“ticket_code”: null,
“ticket_validation_datetime”: null,
“ticket_is_used”: null,
“testing_status”: null,
“user_status_id”: null,
“category_id”: null,
“location_id”: null,
“category”: null,
“location”: null,
“can_be_edited”: true,
“can_be_canceled”: true,
“id”: 50,
“code”: “0081dfpk”,
“start_datetime”: “2021-09-11 19:00:00”,
“end_datetime”: “2021-09-11 20:00:00”,
“service_id”: 2,
“provider_id”: 3,
“client_id”: 24,
“duration”: 60
}
],
“metadata”: {
“items_count”: 8,
“pages_count”: 4,
“page”: 1,
“on_page”: 2
}
}

Dmytro Bondarev wrote:

Hi, please use following request:

GET https://user-api-v2.simplybook.plus/admin/bookings?filter[search]=rahim.ali%40mrm.com&filter[date]=2020-09-06&on_page=2&page=1)

Rahim Ali wrote:

Thanks for the feedback.

Can you please confirm above request will return us all bookings till passed date in filter[date] or it will only return bookings of single passed date?

What about if i want to fetch booking of specific periods like i want to fetch booking of last 12 months?

Dmytro Bondarev wrote:

Hi,
It will return bookings for selected date.
Currently there is not such filter, but you can handle it on your side.

Rahim Ali wrote:

thanks for the clarification

is there a way to get the sorted data like i want to see my those booking first which have closet date(sort by Date asc)

Redmine Admin wrote:

there is no way to do it, you can sort data on your side

Dmytro Bondarev wrote:

&order_field=start_date&order_direction=ASC (or DESC).

Rahim Ali wrote:

Thanks for the feedback

Does the api support to fetch data based on date criteria like i want to fetch bookings after a certain date something like start_date > 2020-09-07(12 month old field)

Dmytro Bondarev wrote:

hi,
as i mentioned before, currently it does not support such criteria.