9
oraro
2y

What the FUCK im fixing integrations on some dumbass's API. Biz wants this in prod on monday. It's fucking saturday. Anyway

Me: why did you give us a 200 even if its an error
Them: thats normal
Me: If it's an error it shouldnt be 200
Them: its a 200 because the api params are correct but differ in value so its not an http error but an api error

lmao

Comments
  • 0
    There are different “schools” regarding this.

    For rest api’s we are encouraged to use http codes to indicate results of operations but at least in older apis http codes where only for exceptional errors that should never occur under normal operations.

    So if the problem was as you mention incompatible parameters that would not constitute an http error.

    Personally I am more on the REST team but I have worked with the older style for far more years than I have worked with REST and changing an existing api is hard since you would need to maintain both until all users have changed, and if you have thousands of customers, breaking changes will take time to propagate.
  • 1
    It's been a while since I professionally worked on API side, but from app/consumer side it's really confusing to return 200 with json { error: incorrect params}

    There's a 400 Bad Request for exactly that case.
Add Comment