Migrated from Redmine #705 | Author: Ovidiu Buruiana
Status: New | Priority: High, I’m very impatient | Created: 2021-06-03
Hello,
My name is Ovidiu and I am developer for duuja project on your platform (our url: Terminbuchungsdienst und kostenloser Online-Buchungsservice )
I have problems to create/edit a booking, even if I followed your API documentation: API documentation | SimplyBook.me Online Scheduling.
All other APIs for get data works (works authorization, get token, get bookings list, get booking details, get client details, get services details..etc) but something does not work when I try to send data to your APIs (POST data in case of create new booking ).
I am using the PHP cUrl method to do the requests.
I am trying to send in POST ( to: https://user-api-v2.simplybook.pro/admin/bookings ) the next set of data (according to documentation):
Post vars:
count=1&start_datetime=2021-06-04+08%3A30%3A00&end_datetime=2021-06-04+08%3A35%3A00&location_id=2&category_id=&provider_id=3&service_id=2&client_id=20&duration=5&additional_fields%5B0%5D%5Bfield%5D=c999e9ac28cdb767dbce99e94863730b&additional_fields%5B0%5D%5Bvalue%5D=Ich+bin+einverstanden&additional_fields%5B1%5D%5Bfield%5D=8b780a9b886d648cab036a41807b4e6f&additional_fields%5B1%5D%5Bvalue%5D=Nein&additional_fields%5B2%5D%5Bfield%5D=fbca8cd12f8f9a725f467c6b3e587f8f&additional_fields%5B2%5D%5Bvalue%5D=Bernd+Mustermann&additional_fields%5B3%5D%5Bfield%5D=6f5f4bbf387476bf9398b4347aac287b&additional_fields%5B3%5D%5Bvalue%5D=777&additional_fields%5B4%5D%5Bfield%5D=489b046522ea9979c7b4f542a0c573eb&additional_fields%5B4%5D%5Bvalue%5D=99&additional_fields%5B5%5D%5Bfield%5D=792a0b265d665836657c9fd3517b70b9&additional_fields%5B5%5D%5Bvalue%5D=987654321
But the response received is the next one:
{“code”:400,“message”:“”,“data”:{“service_id”:[“Invalid type given, value should be float, string, or integer”],“provider_id”:[“Invalid type given, value should be float, string, or integer”],“start_datetime”:[“Invalid type given, value should be float, string, or integer”,“Invalid type given, value should be string, or integer”],“additional_fields”:[{“field”:“c999e9ac28cdb767dbce99e94863730b”,“errors”:[“‘’ was not found in the haystack”,“Invalid type given, value should be float, string, or integer”]},{“field”:“8b780a9b886d648cab036a41807b4e6f”,“errors”:[“‘’ was not found in the haystack”,“Invalid type given, value should be float, string, or integer”]},{“field”:“fbca8cd12f8f9a725f467c6b3e587f8f”,“errors”:[“‘’ was not found in the haystack”,“Invalid type given, value should be float, string, or integer”]},{“field”:“489b046522ea9979c7b4f542a0c573eb”,“errors”:[“Invalid type given, value should be float, string, or integer”]},{“field”:“792a0b265d665836657c9fd3517b70b9”,“errors”:[“Invalid type given, value should be float, string, or integer”]}]},“message_data”:}
Is like no value is recognized or does not reach at your end, as long as the pointed fields contain values as can be seen in my example above.
COuld you let me know which the problem might be?
Thanks,
Ovidiu