[#106] Get List Booking API

Migrated from Redmine #106 | Author: jasmine JJ
Status: Closed | Priority: Normal | Created: 2018-02-07


Hello there,
I am trying to get list booking through API getBookings() but I don’t know exactly format request so I test quit this
{“jsonrpc”:“2.0”,“method”:“getBookings()”,“id”:“1”,“params”:{“date_from”:“2017-01-01”,“date_to”:“2017-12-12”}}
but it response invalid request, so could you please help me correct this format.
Thank you

Dmytro Bondarev wrote:

Hi! Please remove () in method name and use non named parameters.
{“jsonrpc”:“2.0”,“method”:“getBookings”,“id”:“1”,“params”:[{“date_from”:“2017-01-01”,“date_to”:“2017-12-12”}]}

jasmine JJ wrote:

My bad. Thank you so much. :D. I will be more carefully before asking you guys.

jasmine JJ wrote:

By the way , Can I ask Does Simplybook.me notify when have something change such as new booking, booking is cancelled. Do we have any api to get this

Dmytro Bondarev wrote:

Hi! Yes you can use API callback. Please see API plugin settings.

jasmine JJ wrote:

I’m sorry when asking again but when I request
{“jsonrpc”:“2.0”,“method”:“getBookings”,“id”:“1”,“params”:{“params”:[{“date_from”:“2018-01-20”,“date_to”:“2018-01-21”,“booking_type”:“all”,“order”:“start_date”,“unit_group_id”:6,“event_id”:1}]}}
I still receive booing with another unit_id and event id at another time.
For example: when request like above I receive
{
“id”: “1”,
“record_date”: “2018-01-15 16:49:45”,
“start_date”: “2018-01-15 17:00:00”,
“end_date”: “2018-01-15 18:00:00”,
“unit_id”: “1”,

“event_id”: “1”

}

jasmine JJ wrote:

jasmine JJ wrote:

I’m sorry when asking again but when I request
{“jsonrpc”:“2.0”,“method”:“getBookings”,“id”:“1”,“params”:{“params”:[{“date_from”:“2018-01-20”,“date_to”:“2018-01-21”,“booking_type”:“all”,“order”:“start_date”,“unit_group_id”:6,“event_id”:1}]}}
I still receive booing with another unit_id and event id at another time.
For example: when request like above I receive

 {
 		"id": "1",
 	        "record_date": "2018-01-15 16:49:45",
 		"start_date": "2018-01-15 17:00:00",
 		"end_date": "2018-01-15 18:00:00",
	        "unit_id": "1",
               ...	
		"event_id": "1"
		
 	}

Dmytro Bondarev wrote:

Hi!

{“jsonrpc”:“2.0”,“method”:“getBookings”,“id”:“1”,“params”:{“params”:[{“date_from”:“2018-01-20”,“date_to”:“2018-01-21”,“booking_type”:“all”,“order”:“start_date”,“unit_group_id”:6,“event_id”:1}]}}
Must be:
{“jsonrpc”:“2.0”,“method”:“getBookings”,“id”:“1”,“params”:[{“date_from”:“2018-01-20”,“date_to”:“2018-01-21”,“booking_type”:“all”,“order”:“start_date”,“unit_group_id”:6,“event_id”:1}]}

jasmine JJ wrote:

Ok, Thank again. :smiley:

(Short original content)