[#987] We are unable to do bookings in https://magrabi.com/sa-en site

Nishant Singh wrote:

Hi please also check the below booking site for KBR alRashed Mall :

1st request goes to:
SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
Request: {
“jsonrpc”:“2.0”,
“method”:“getToken”,
“params”:[
“alrashedmall”,
“ecdab9e4ac8f6f8dea07dbfafed3f22c10426e62569fb8fd09922127dc4e62c1”
],
“id”:2
}

Response: {
“result”:“04f89e423afdc7e39ac6994372886adf333a32c518e0d174b922bcad97c1b2b7”,
“id”:“2”,
“jsonrpc”:“2.0”,
“error”:null
}

2nd request goes to : SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com]
Request: {
“jsonrpc”:“2.0”,
“method”:“getStartTimeMatrix”,
“params”:[
“2022-12-30”,
“2022-12-30”
],
“id”:15
}

Response: {
“id”:“15”,
“jsonrpc”:“2.0”,
“error”:null,
“result”:{
“2022-12-30”:[
“10:00:00”,
“10:30:00”,
“11:00:00”,
“11:30:00”,
“12:00:00”,
“12:30:00”,
“13:00:00”,
“13:30:00”,
“14:00:00”,
“14:30:00”,
“15:00:00”,
“15:30:00”,
“16:00:00”,
“16:30:00”,
“17:00:00”,
“17:30:00”,
“18:00:00”,
“18:30:00”,
“19:00:00”,
“19:30:00”,
“20:00:00”,
“20:30:00”,
“21:00:00”
]
}
}
3rd Request goes to :SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
request: {
“jsonrpc”:“2.0”,
“method”:“getUserToken”,
“params”:[
“alrashedmall”,
“magrabistoreaccount”,
“Magrabi@123”
],
“id”:1
}
response: {
“result”:null,
“id”:“1”,
“jsonrpc”:“2.0”,
“error”:{
“code”:“-32000”,
“message”:“User with this login and password not found”,
“data”:[

  ]

}
}
4th request goes to: SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
request: {
“jsonrpc”:“2.0”,
“method”:“getToken”,
“params”:[
“alrashedmall”,
“7d99098ff24a960133cd96a76a7dd6a705db16c5edcc87ff2cc7bbf71b8f6498”
],
“id”:2
}
response: {
“result”:“e1c96cc44c0a3e3d70dc924c6b512018a52c13efbd78a5c765f23fa60a9ec01e”,
“id”:“2”,
“jsonrpc”:“2.0”,
“error”:null
}
5th request goes to: SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com]
request:
{
“jsonrpc”:“2.0”,
“method”:“book”,
“params”:[
null,
null,
“2022-12-21”,
“14:40:00”,
{
“name”:“Nishant singh”,
email":"nishant@juneits.com”,
“phone”:“966501222222”
}
],
“id”:14
}
response:
{
“id”:“14”,
“jsonrpc”:“2.0”,
“error”:{
“code”:“-32051”,
“message”:“Selected event id is not available”,
“data”:[

  ]

},
“result”:null
}

Nishant Singh wrote:

I think this is an error as we are getting the slot for bookings ,but after proceeding ,in the response it is throwing error as “message”:“User with this login and password not found” for the given booking account

Redmine Admin wrote:

it seems you enabled client login custom feature and need to book using admin API or provide client auth

Dmytro Bondarev wrote:

Hi, you send request with invalid provider and service ids, you receive error. it is correct behavior.
Please pass correc t unitId and eventId parameters.

...
"method":"book",
"params":[
null,
null,
...

Nishant Singh wrote:

Can you please explain in detail what is invalid provider and service id above? Also when we try booking from our UAE site the booking is getting booked successfully , but for our saudi arabia site we are not able to .Given below is an example of UAE booking site for aanjimimall where we are able to successfully book the eyetest. :

1st request goes to:
SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
Request: {
“jsonrpc”:“2.0”,
“method”:“getToken”,
“params”:[
“aanjimimall”,
“ecdab9e4ac8f6f8dea07dbfafed3f22c10426e62569fb8fd09922127dc4e62c1”
],
“id”:2
}

Response: {
“result”:“04f89e423afdc7e39ac6994372886adf333a32c518e0d174b922bcad97c1b2b7”,
“id”:“2”,
“jsonrpc”:“2.0”,
“error”:null
}

2nd request goes to : SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com]
Request: {
“jsonrpc”:“2.0”,
“method”:“getStartTimeMatrix”,
“params”:[
“2022-12-30”,
“2022-12-30”
],
“id”:15
}

Response: {
“id”:“15”,
“jsonrpc”:“2.0”,
“error”:null,
“result”:{
“2022-12-30”:[
“10:00:00”,
“10:30:00”,
“11:00:00”,
“11:30:00”,
“12:00:00”,
“12:30:00”,
“13:00:00”,
“13:30:00”,
“14:00:00”,
“14:30:00”,
“15:00:00”,
“15:30:00”,
“16:00:00”,
“16:30:00”,
“17:00:00”,
“17:30:00”,
“18:00:00”,
“18:30:00”,
“19:00:00”,
“19:30:00”,
“20:00:00”,
“20:30:00”,
“21:00:00”
]
}
}
3rd Request goes to :SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
request: {
“jsonrpc”:“2.0”,
“method”:“getUserToken”,
“params”:[
“aanjimimall”,
“magrabistoreaccount”,
“Magrabi@123”
],
“id”:1
}
response:{
“result”:“8cc7ea8a091b2e9eb36cff4e2fbf9faa74e30c3c07489c9c1640cdb82e50c099”,
“id”:“1”,
“jsonrpc”:“2.0”,
“error”:null
}

4th request goes to [https://user-api.enterpriseappointments.com/admin]
request:{
“jsonrpc”:“2.0”,
“method”:“getEventList”,
“params”:[

],
“id”:9
}
response:{
“id”:“9”,
“jsonrpc”:“2.0”,
“error”:null,
“result”:{
“1”:{
“id”:“1”,
“name”:“EYE TEST”,
“duration”:“20”,
“buffertime_before”:“0”,
“buffertime_after”:“20”,
“hide_duration”:“0”,
“description”:“

MAGRABi - over 90 years of science and art

<b style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 16px;"> 150 AED   <span style="color: rgb(34, 34, 34); font-size: 18px;">FREE!

“,
“is_public”:“1”,
“is_active”:“1”,
“position”:“1”,
“file_id”:“2”,
“seo_url”:“magrabi”,
“is_recurring”:“0”,
“picture”:“ee2c3228abd508c0a4aa4bbd35b2a246.jpeg”,
“picture_sub_path”:”/image_files”,
“is_visible”:“1”,
“picture_path”:“/uploads/aanjimimall/image_files/preview/ee2c3228abd508c0a4aa4bbd35b2a246.jpeg”,
“classes_plugin_info”:{
“unit_group_binded_in_class”:null,
“unit_groups_binded_in_classes”:[

        ],
        "event_binded_in_class":null,
        "events_binded_in_classes":null
     },
     "phone":null,
     "email":null,
     "station_id":null,
     "qty":null
  }

}
}
5th request goes to:[https://user-api.enterpriseappointments.com/admin]
request: {
“jsonrpc”:“2.0”,
“method”:“getUnitList”,
“params”:[

],
“id”:10
}

response:
{
“id”:“10”,
“jsonrpc”:“2.0”,
“error”:null,
“result”:{
“1”:{
“id”:“1”,
“name”:“Jimi Mall”,
“duration”:null,
“buffertime_before”:null,
“buffertime_after”:null,
“hide_duration”:null,
“description”:“<span data-sheets-value="{"1":2,"2":"Shop EGF 03, Ground Floor, Al Jimi Mall Street, Al Ain, UAE"}" data-sheets-userformat="{"2":8705,"3":{"1":0},"12":0,"16":8}" style="font-size: 8pt; font-family: Arial;">Shop EGF 03, Ground Floor, Al Jimi Mall Street, Al Ain, UAE
”,
“is_public”:null,
“is_active”:“1”,
“position”:“1”,
“file_id”:null,
“seo_url”:“magrabi”,
“is_recurring”:null,
“picture”:null,
“picture_sub_path”:null,
“is_visible”:“1”,
“picture_path”:null,
“classes_plugin_info”:{
“unit_group_binded_in_class”:null,
“unit_groups_binded_in_classes”:null,
“event_binded_in_class”:null,
“events_binded_in_classes”:[

        ]
     },
     "phone":"+971564084298",
     "email":"uaeajm@Magrabi.com",
     "station_id":"1",
     "qty":"1"
  }

}
}

6th request goes to |POST: [https://user-api.enterpriseappointments.com/login]
request :
{
“jsonrpc”:“2.0”,
“method”:“getToken”,
“params”:[
“aanjimimall”,
“a2e469bc3cdec66a3c3195d8a7181df1f512cd01d94d7428e434b77185424f17”
],
“id”:2
}
response:
{
“result”:“8e099d80f7773fb5fde292a101725297e1433eccb809b8f49ad55e3e2e80eec8”,
“id”:“2”,
“jsonrpc”:“2.0”,
“error”:null
}
7th request goes to :|POST: [https://user-api.enterpriseappointments.com]
request :
{
“jsonrpc”:“2.0”,
“method”:“book”,
“params”:[
“1”,
“1”,
“2022-12-25”,
“16:50:00”,
{
“name”:“Nishant singh”,
email":"nishant@juneits.com”,
“phone”:“971501222222”
}
],
“id”:14
}

response:
{
“id”:“14”,
“jsonrpc”:“2.0”,
“error”:null,
“result”:{
“require_confirm”:false,
“bookings”:[
{
“id”:“585”,
“record_date”:null,
“start_date”:null,
“end_date”:null,
“client_timezone”:null,
“unit_id”:“1”,
“text”:null,
“client”:null,
“unit”:null,
“unit_email”:null,
“event”:null,
“event_id”:“1”,
“is_confirm”:null,
“client_id”:“693”,
“client_phone”:null,
“client_email”:null,
“offset”:null,
“comment”:null,
“code”:“09xg8bof”,
“event_duration”:null,
“event_buffertime_before”:null,
“event_buffertime_after”:null,
“batch_is_confirm”:null,
“is_google_maps_booking”:false,
“is_confirmed”:“1”,
“event_name”:null,
“event_description”:null,
“deposit_is_enabled”:0,
“deposit_event_price”:null,
“event_price”:null,
“event_currency”:null,
“event_tax_id”:null,
“event_image”:null,
“event_image_path”:null,
“invoice_id”:null,
“invoice_number”:null,
“invoice_status”:null,
“invoice_currency”:null,
“invoice_line_amount”:null,
“invoice_payment_received”:null,
“invoice_amount”:null,
“invoice_payment_processor”:null,
“invoice_payment_processor_id”:null,
“unit_name”:null,
“unit_description”:null,
“unit_phone”:null,
“unit_image”:null,
“unit_image_path”:null,
“start_date_time”:“2022-12-25 16:50:00”,
“end_date_time”:“2022-12-25 17:30:00”,
“client_name”:null,
“client_address1”:null,
“client_address2”:null,
“client_city”:null,
“client_zip”:null,
“client_country_id”:null,
“online_meeting_id”:null,
“company_login”:null,
“company_name”:null,
“company_phone”:null,
“company_email”:null,
“additional_fields”:null,
“comments”:null,
“history”:null,
“status”:null,
“location”:null,
“price”:null,
“promo”:null,
“client_hash”:“132acf6a4ae941813c694f50cdee49c2”,
“require_payment”:false,
“hash”:“8b0b69d97a00a0f5364894e056329584”
}
],
“invoice”:null
}
}

Dmytro Bondarev wrote:

In this case you passed correct data and you received response with booking details.

...
"method":"book",
"params":[
"1",
"1",
...

In previous examples you sent null instead of ids:

...
"method":"book",
"params":[
null,
null,
...

This is incorrect data.

Please always send only required requests and response data.

Nishant Singh wrote:

I understood but this is being passed as null because for one of the request we are getting “message”:“User with this login and password not found”, then after this null is passed

:SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
request: {
“jsonrpc”:“2.0”,
“method”:“getUserToken”,
“params”:[
“alrashedmall”,
“magrabistoreaccount”,
“Magrabi@123”
],
“id”:1
}
response: {
“result”:null,
“id”:“1”,
“jsonrpc”:“2.0”,
“error”:{
“code”:“-32000”,
“message”:“User with this login and password not found”,
“data”:[ {
“jsonrpc”:“2.0”,
“method”:“book”,
“params”:[
null,
null,
“2022-12-21”,
“14:40:00”, {
“name”:“Nishant singh”,
email":"nishant@juneits.com”,
“phone”:“966501222222”
}
],
“id”:14
}
response: {
“id”:“14”,
“jsonrpc”:“2.0”,
“error”:{
“code”:“-32051”,
“message”:“Selected event id is not available”,
“data”:[

]
},
“result”:null
}

Nishant Singh wrote:

and we did not enable client login

Dmytro Bondarev wrote:

Hm. Why did you decide to pass these params as null and how it could solve the issue?

This is strange solution. It will not help you.
These parameters are required.

Nishant Singh wrote:

Thank you so much team for your support and patience. We found the root cause and fix . Hence closing this ticket