Returning HTTP 500 for Bad Requests with Invalid Dates

Forum for users and developers of Bullhorn's new REST API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
bashen
User
Posts: 1
Joined: Wed Jul 11, 2018 5:09 pm

Returning HTTP 500 for Bad Requests with Invalid Dates

Post by bashen » Thu Aug 09, 2018 2:03 pm

Hi all,

I was testing updating a custom object in Postman and specifying invalid values in my JSON body. In one case, I specified a custom date field with a decimal value (1533132317.34) and got back the following response.

Code: Select all

{
    "errorMessage": "setting property",
    "errorMessageKey": "errors.errorSettingProperty",
    "errorCode": 500,
    "errors": [
        {
            "detailMessage": "cannot convert value to data type for field date1",
            "propertyName": "date1",
            "severity": "ERROR",
            "type": "IMPROPERLY_STRUCTURED_SCALAR"
        }
    ],
    "entityName": "PlacementCustomObjectInstance1"
}
It's a good error message but it's returning a HTTP 500 status code and not a HTTP 400 Bad Request. I usually assume anything in the 500-range are transient errors that I can attempt a retry but in this case the request will always fail. According to your documentation, HTTP 500 is a problem on your end but in this case it was on my end.

It's probably just a minor edge case but I figured you would want to know and fix the return code in this scenario.

Cheers,
Brian

Post Reply