[#735] There is a queue to make a booking. No worries, you are already waiting in line!

Migrated from Redmine #735 | Author: Simon Baconnais
Status: Feedback | Priority: Normal | Created: 2021-07-13


Hello,

I’m working on your API and i often get this error message in plain HTML instead of JSON:

There is a queue to make a booking.

No worries, you are already waiting in line!

What does it mean and how can I resolve it ?

Code :

        payload = json.dumps({
        "jsonrpc": "2.0",
        "id": 1,
        "method": "getBookings",
        "params": [{
            "date_from": str(date(d.year, d.month, d.day)),
            "booking_type": "non_cancelled" if is_confirmed == "1" else "cancelled"
            }]
        })

        headers = {
        'X-Company-Login': self.company_login,
        'X-User-Token': self.token,
        'Content-Type': 'application/json'
        }

        try:
            response = requests.request("POST", url, headers=headers, data=payload)
            bookings = json.loads(response.text)['result']
            return bookings
        except json.decoder.JSONDecodeError as e:
            print("JSONDecodeError")
            print(e)
            print(response.text)
            msg = f"Something went wrong when we tried to log in\nError : {e}\nResponse : {response.text}\n"

Dmytro Bondarev wrote:

Hi! Please provide your company URL and API endpoint that you use.

Simon Baconnais wrote:

Company logins :
evagym
atriumsportsclub

Dmytro Bondarev wrote:

correct endpoints for your compnies is user-api.simplybook.it , user-api-v2.simplybook.it
Make sure that you are using .it , not .me.

Simon Baconnais wrote:

Thanks,

Documentation says “Service URL https://user-api.simplybook.me/admin

Where can I find the correct endpoint for each company (I have other companies to integrate) ?

Dmytro Bondarev wrote:

you can see it from your company URL:
evagym.simplybook.it - means that API endpoint must be ended with .it

Simon Baconnais wrote:

And i know if I have to use user-api.simplybook.it or user-api-v2.simplybook.it because of that : https://evagym.secure.simplybook.it*/v2/ ?

Simon Baconnais wrote:

And i know if I have to use user-api.simplybook.it or user-api-v2.simplybook.it because of that : https://evagym.secure.simplybook.it*/v2/* ?

Dmytro Bondarev wrote:

user-api. - is JSON RPC.
user-api-v2 - is REST API.

Simon Baconnais wrote:

Thank you :slight_smile:

Would this explain why it sometimes works, sometimes not ?

Simon Baconnais wrote:

I switched to .it but problem remains …

Dmytro Bondarev wrote:

Please send RAW HTTP request (with urls and headers, you can omit token) and response.