[#1196] Blocked from making requests from my localhost

Migrated from Redmine #1196 | Author: Guilherme Bueno
Status: Feedback | Priority: High, I’m very impatient | Created: 2024-03-13


It seems I’ve been blocked of trying to make API requests from my localhost. Now everytime I try to make an API call I receive an empty response, code didn’t change just stopped working out of nowhere, how should I proceed?

Dmytro Bondarev wrote:

Hi, what is HTTP status?

Guilherme Bueno wrote:

Headers:
[
“headers” => [
“X-Token” => “6bdde6bdc8c4591cf58d10a75a98ffb734854837a149cdbf2137fbc087e8ce08”
“X-Company-Login” => “santemedic1”
“Content-type” => “application/json; charset=utf-8”
]
]

Request URL: ‘POST’, ‘https://user-api-v2.simplybook.plus/admin/bookings

Body:

{
“count”: “1”,
“start_datetime”: “2024-03-14 9:20:00”,
“end_datetime”: “2024-03-14 9:35:00”,
“location_id”: 2,
“provider_id”: “2”,
“service_id”: “26”,
“client_id”: 17149,
“accept_payment”: “true”,
“payment_processor”: “Stripe”,
“additional_fields”: [
{
“field”: “473dd5d43a9146537758de98a4909a18”,
“value”: “Pending”
},
{
“field”: “d5f910103c49904d8ac7b7a59be249b5”,
“value”: "Customer agreed to pay $0 and for the tests: "
}
]
}

Response body: “”

Guilherme Bueno wrote:

HTTP status is set to 200 ok

Guilherme Bueno wrote:

Screenshot of the response I’m receiving from the api

Dmytro Bondarev wrote:

Could you please clarify if booking was created?

Guilherme Bueno wrote:

No, booking was not created

Dmytro Bondarev wrote:

Checked with your data.
I got 400 status

HTTP/1.1 400 Bad Request

{
  "code": 400,
  "message": "",
  "data": {
    "additional_fields": [
      {
        "field": "45234aef3437bd78788fb92a71e41e41",
        "errors": [
          "Invalid type given, value should be string, integer or float"
        ]
      }
    ]
  },
  "message_data": []
}

Which is correct answer, please double check that it is our server returns 200.

Guilherme Bueno wrote:

You are correct, after some digging it seems guzzle for some reason shows 200 as the status for the request but I do see these errors in the logs. Thank you!