system
July 28, 2022, 8:23pm
1
Migrated from Redmine #915 | Author: brian kling
Status: New | Priority: Immediate, there is BUG! | Created: 2022-07-28
trying to hit
POST https://user-api-v2.simplybook.me/admin/bookings
to create a new booking, and we get this very vague error response, even if the api key is invalid or valid:
400 Bad Request
400 Bad Request
nginx
Example payload:
{
“start_datetime”: “2022-07-30 00:00:00”,
“end_datetime”: “2022-07-30 00:15:00”,
“provider_id”: 1,
“service_id”: 110,
“client_id”: 11,
“location_id”: 1,
“category_id”: 1,
“count”: 1
}
can you please paste a working example, this code does not work:
var config = {
method: 'post',
url: `https://user-api-v2.simplybook.me/admin/bookings`,
headers: {
'Content-Type': 'application/json',
'X-Company-Login': 'xxxxxx',
'X-Token': simplyBookApiKey
},
data: bookingObj
};
let resp = await axios(config);
console.log("GET RESPONSE: ", resp.data);
system
July 29, 2022, 6:38am
2
Dmytro Bondarev wrote:
Hi, can you please provide RAW HTTP request?
system
July 29, 2022, 9:20am
3
brian kling wrote:
Dmitry Bondarev wrote:
Hi, can you please provide RAW HTTP request?
POST /admin/bookings HTTP/1.1
Host: user-api-v2.simplybook.me
X-Company-Login: xxxxx
X-Token: 20642e45cfaa738e4954f8c…
Content-Type: application/json
Content-Length: 200
{
“start_datetime”: “2022-07-30 00:00:00”,
“end_datetime”: “2022-07-30 00:15:00”,
“provider_id”: 1,
“service_id”: 110,
“client_id”: 11,
“location_id”: 1,
“category_id”: 1,
“count”: 1
}
company name and token have been obscured for security, but we are able to hit all the other rest endpoints just fine like cancel meeting which is used frequently.
system
July 29, 2022, 9:25am
4
brian kling wrote:
Dmitry Bondarev wrote:
Hi, can you please provide RAW HTTP request?
also, here is example of working code to another endpoint with the same exact request settings:
let bookingId = req.body.bookingId;
var config = {
method: 'get',
url: `https://user-api-v2.simplybook.me/admin/bookings/${bookingId}`,
headers: {
'Content-Type': 'application/json',
'X-Company-Login': 'xxxxxx',
'X-Token': simplyBookApiKey
}
};
let resp = await axios(config);
console.log("GET RESPONSE: ", resp.data);