API response Status Code is changed from 500 to 400

In the API: https://api.mypurecloud.com/api/v2/quality/evaluations/query/
Previously whenever we were trying to read a page which doesn't exists, API was giving a response status code as '500' and message 'internal server error'.
But from Effective date : 12/10/2021 , for same scenario we are getting response status code as '400' and message 'Bad request'.
Wanted to confirm that is there any API changes that took place due to which we are seeing these status code changes.

Hi Priyanka,

I am going to forward your inquiry to our product manager. This sounds suspiciously like you were encountering some kind of error in the service that was causing a 500 status code. We generally use 500 error codes to indicate "on snap something really bad happened" and we don't know how to respond. The change to the 400 status code sounds like the dev team probably saw the problem, resolved the thing that was causing the service to panic, and returned a 400 status code to indicate that a bad request was made by the caller. Typically, a 400 indicates you as the caller are sending something into the service incorrectly.

This is all conjecture, but that is my guess what happens. Let me see if can find some more details for you.

Thanks,
John Carnell
Manager, Developer Engagement

Hello Priyanka,

John's assessment is correct. We have recently modified the evaluations/query API, so instead of showing a generic 500 status code when requesting a page that does not exist, the API now returns a 400 error, which conveys a bad request made by the caller. The full API response in this case is:
Status = 400
Code = bad.request
Message = Page number X exceeds maximum possible page number X

Regards
Jose Ruiz
WEM Product Manager

Thanks John and Jose for update!!
Are these changes permanent?
Do we have any medium through which we can get this information in advance ?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.