Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 411451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:59:17+00:00 2026-05-12T17:59:17+00:00

I have a REST-ish API that returns JSON. One of the output fields is

  • 0

I have a REST-ish API that returns JSON. One of the output fields is status, which indicates if the call succeeded. I gather that it’s somewhat standard to use numeric status codes such as

200 success
400 syntax error
401 authentication error
402 general error
404 user not found
408 timed out
500 fatal error
501 not yet implemented

Are there any reasons (other than to transmit slightly fewer bytes) to use numeric codes rather than more descriptive symbols as the status, like

success
syntax_error
auth_error
general_error
user_not_found_error
time_out_error
fatal_error
not_yet_implemented_error

Pointing to modern precedents in well-respected APIs would be helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:59:18+00:00Added an answer on May 12, 2026 at 5:59 pm

    You can make them what you want, as long as they are standard (across your app) and documented for the benefit of those using the webservice.

    The fondness of using HTTP status codes such as 404 is that a true REST webservice is based on HTTP transport, so it makes sense to use recognised standards.

    That said, you may find that the HTTP/1.1 status codes are not an exact fit – such as your ‘404 user not found’ equivalent to ‘404 not found’ – I think as long as the meaning is there then fine.

    If you have to create completely new codes, it’s worth sticking to the HTTP groups – 2xx for acceptable results, 3xx for required changes, 4xx for client-side errors and 5xx for server-side errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a REST API which clients routinely POST and PUT data to. When
I'm writing a small application which exposes a simple REST-ish HTTP API. I'm stuck
I have a REST web service that returns an xml result like this: -
I have a REST service which takes JSON and XML as input and does
I have a REST API where I would like to cache the JSON response
I have a REST service that I'm trying to call. It requires something similar
I have a REST API that I am trying to access using Rails 3.0.1
We have a Rest API that requires client certificate authentication. The API is used
I have a REST web-service interface that calls-down to a service layer which orchestrates
I have a C# WCF REST Service which allows the addition of a bookmark,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.