[#560] CancelBooking

Migrated from Redmine #560 | Author: David Liew
Status: New | Priority: Normal | Created: 2020-08-23


Hi , I been try to cancel a booking. Keep getting the below error. i am using public API

{“error”:{“code”:-32085,“message”:“Signature error”,“data”:},“id”:“1”,“jsonrpc”:“2.0”}

	"bookings": [
		{
			"id": "89",
			"event_id": "4",
			"unit_id": "13",
			"client_id": "85",
			"client_hash": "4e93f64943ef98fe4899a0cbb21f1d0a",
			"start_date_time": "2020-08-23 15:00:00",
			"end_date_time": "2020-08-23 16:00:00",
			"time_offset": "0",
			"is_confirmed": "1",
			"require_payment": true,
			"code": "90h2gcra",
			"hash": "54c074abfc053952a70340fd44a7d83e"
		}

I have input as below

Sign= CreateMD5(“89.54c074abfc053952a70340fd44a7d83e.” + API_SECRET_KEY);
jsonData = “{"jsonrpc":"2.0",” + “"method":"cancelBooking",” + “"params":[89,"”+Sign+“"],"id":1}”;

Redmine Admin wrote:

hi, it seems there is confusion in concatenation operator: it is . (dot) in PHP but + in your lang. It seems you need to call CreateMD5(“8954c074abfc053952a70340fd44a7d83e” + API_SECRET_KEY);

David Liew wrote:

Noted. Its works. thanks for the tip.