[#658] How to get all the bookings matching with a given value in additional field using REST API?

Migrated from Redmine #658 | Author: mike hk
Status: New | Priority: Immediate, there is BUG! | Created: 2021-03-04


I have 1 additional field set up in the simplbook custom features section and was able to make a booking through the REST API “API documentation | SimplyBook.me Online Scheduling

{
  "count": 1,
  "start_datetime": "2020-12-02 09:30:00",
  "location_id": 2,
  "category_id": 2,
  "provider_id": 4,
  "service_id": 3,
  "client_id": 10,
  "additional_fields": [
    {
      "field": "e5a1d0e5312b9515874406a89c986765", //occasion 
      "value": "birthday"
    }
  ]
}

Now I would like to get all the bookings that have the occasion “birthday”.
I see the “Get booking list” API has the filters that I can pass in “API documentation | SimplyBook.me Online Scheduling

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

How can I search for the additional field “occasion”, do I pass the field is like this?

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

Please help

Nicholas Alias wrote:

GET https://user-api-v2.simplybook.me/admin/bookings?filter[additional_fields][e5a1d0e5312b9515874406a89c986765]=birthday

mike hk wrote:

Thank you! will give it a try