What http status code should I use when customer configuration is not correct?

Mike Kantor

I am unsure what http status code to return when a customer calls my API, but the requested action cannot be completed for reasons that the customer can fix.

In this case, the http request itself may be fine, but it will not succeed until the customer logs into the front end and updates their configuration. (I will return a body with some informative message to indicate this.)

Is 412 - Precondition Failed - appropriate for this case?

user5547025

412 Precondition Failed

The server does not meet one of the preconditions that the requester put on the request.

This statuscode has a spefic meaning. It is about a condition that the client stated in the request, whichthe server was unable to fullfill. Don't use this status code for your scenario.

The only HTTP status code that can be used is 400 Bad Request. It is the catch-all status code for all errors that the client can fix. Since you return detailed information about how the client can do this, the client has everything necessary.

see Wikipedia: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What HTTP status code should I use for nickname validation?

From Dev

What HTTP status code should I use for nickname validation?

From Dev

What status code should I use when session token is invalid?

From Dev

What HTTP status code should I return for POST when no resource is created?

From Dev

What is the correct http status code to return when a DELETE cannot be performed?

From Dev

What is the correct http status code to return when a DELETE cannot be performed?

From Dev

When redirecting from http to https, which status code should I use?

From Dev

What HTTP error code should I use when trying to insert an already existing object?

From Dev

What should be the Http Status code for Request pending?

From Dev

HTTP Status Code 206: When should it be used?

From Dev

HTTP status code 202 or 303. When I need use it?

From Dev

Which HTTP status code should I use for a health-check failure?

From Dev

What status code should I response with when there is no data found in my database

From Dev

what should be HTTP status code if resource is not available for requested action?

From Dev

what should be HTTP status code for credentials Expired error/exception?

From Dev

what should be HTTP status code if resource is not available for requested action?

From Dev

Correct http status code to use if delete was only partially successful?

From Dev

Correct http status code to use if delete was only partially successful?

From Dev

What settings should I use to keep the colour correct when converting a PDF to x-3:2002 with ghostscript?

From Dev

What should I use as a hash code of null?

From Dev

What should I use as a hash code of null?

From Dev

Is my code solution for Binary Gap is correct or not? What should I improved in that?

From Java

What is a "span" and when should I use one?

From Dev

What HTTP Method should I use when making a request for an API controller to do a back-end function?

From Dev

What HTTP status code to use for 'account required' pages?

From Dev

What HTTP response status code to use for unrelated redirects of random chance?

From Dev

What (if any) http status code is returned when a MIME type is missing?

From Dev

What is the HTTP status code of the response when the request implement IReturnVoid?

From Dev

-11855 error code when using AVFoundation with high res video. What resolution should I use?

Related Related

  1. 1

    What HTTP status code should I use for nickname validation?

  2. 2

    What HTTP status code should I use for nickname validation?

  3. 3

    What status code should I use when session token is invalid?

  4. 4

    What HTTP status code should I return for POST when no resource is created?

  5. 5

    What is the correct http status code to return when a DELETE cannot be performed?

  6. 6

    What is the correct http status code to return when a DELETE cannot be performed?

  7. 7

    When redirecting from http to https, which status code should I use?

  8. 8

    What HTTP error code should I use when trying to insert an already existing object?

  9. 9

    What should be the Http Status code for Request pending?

  10. 10

    HTTP Status Code 206: When should it be used?

  11. 11

    HTTP status code 202 or 303. When I need use it?

  12. 12

    Which HTTP status code should I use for a health-check failure?

  13. 13

    What status code should I response with when there is no data found in my database

  14. 14

    what should be HTTP status code if resource is not available for requested action?

  15. 15

    what should be HTTP status code for credentials Expired error/exception?

  16. 16

    what should be HTTP status code if resource is not available for requested action?

  17. 17

    Correct http status code to use if delete was only partially successful?

  18. 18

    Correct http status code to use if delete was only partially successful?

  19. 19

    What settings should I use to keep the colour correct when converting a PDF to x-3:2002 with ghostscript?

  20. 20

    What should I use as a hash code of null?

  21. 21

    What should I use as a hash code of null?

  22. 22

    Is my code solution for Binary Gap is correct or not? What should I improved in that?

  23. 23

    What is a "span" and when should I use one?

  24. 24

    What HTTP Method should I use when making a request for an API controller to do a back-end function?

  25. 25

    What HTTP status code to use for 'account required' pages?

  26. 26

    What HTTP response status code to use for unrelated redirects of random chance?

  27. 27

    What (if any) http status code is returned when a MIME type is missing?

  28. 28

    What is the HTTP status code of the response when the request implement IReturnVoid?

  29. 29

    -11855 error code when using AVFoundation with high res video. What resolution should I use?

HotTag

Archive