system
1
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"
system
2
Dmytro Bondarev wrote:
Hi! Please provide your company URL and API endpoint that you use.
system
3
Simon Baconnais wrote:
Company logins :
evagym
atriumsportsclub
system
4
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.
system
5
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) ?
system
6
Dmytro Bondarev wrote:
you can see it from your company URL:
evagym.simplybook.it - means that API endpoint must be ended with .it
system
7
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/ ?
system
8
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/* ?
system
9
Dmytro Bondarev wrote:
user-api. - is JSON RPC.
user-api-v2 - is REST API.
system
10
Simon Baconnais wrote:
Thank you 
Would this explain why it sometimes works, sometimes not ?
system
11
Simon Baconnais wrote:
I switched to .it but problem remains …
system
12
Dmytro Bondarev wrote:
Please send RAW HTTP request (with urls and headers, you can omit token) and response.