• Send Us A Tip
  • Calling all Tech Writers
  • Advertise
Tuesday, May 13, 2025
  • Login
  • Register
TechStory
  • News
  • Crypto
  • Gadgets
  • Memes
  • Gaming
  • Cars
  • AI
  • Startups
  • Markets
  • How to
No Result
View All Result
  • News
  • Crypto
  • Gadgets
  • Memes
  • Gaming
  • Cars
  • AI
  • Startups
  • Markets
  • How to
No Result
View All Result
TechStory
No Result
View All Result
Home Tech

8 Common API Error Examples and Use Cases

by Rohan Mathawan
October 21, 2022
in Tech
Reading Time: 3 mins read
0
8 Common API Error Examples and Use Cases
TwitterWhatsappLinkedin

Introduction

The following list contains common API error codes and their use cases.

You might also like

Weekly Tech News – First Week of May 2025

JustDeliveries Raises ₹5.5 Cr to Redefine Cold Chain Logistics in India

Mittal’s Airtel Eyes 49% Stake in Haier India; Reliance, Dabur Not Far Behind

404

404 – The requested resource could not be found

The server can’t find the requested resource on the server.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

403

A client sends a request to the server and receives a response with HTTP status code 403. The body of this response contains information about what is wrong with the request, including the reason for failure and an error message.

For example:

“`ruby class SignUpController < ApplicationController def create @user = User.create!(params[:user]) redirect_to users_url end end “`

400

The request could not be understood by the server due to malformed syntax.

This is a server error, meaning it’s an issue with your app. The response has a 400 status code and a “Bad Request” message in its body, like this:

“`   Bad Request  “`

500

The 500 Internal Server Error is a standard error code used in many scenarios. It’s a generic message indicating that the server encountered an error and doesn’t provide additional information.

The response body of this status code usually contains more information about the type of error that occurred on the server. For example:

“`{ “message”: “An unexpected condition was encountered”, “error”: { “code”: 500, “title”: “InternalServerError” } }“`

410

The server is unwilling to process the request due to a limitation. The server has timed out, waiting for a response.

407

The request entity is too large. The request message body is too large.

408

The most common example is if you are trying to access a resource that requires authentication. For example, let’s say your user is trying to access their account on the API, but they don’t have any credentials. The client will receive a 408 error and should prompt the user for their credentials before making another request.

429

429 is a permanent HTTP status code. It indicates that the server does not want to complete the request because it’s too large. This could be due to several reasons, such as:

  • The request body is too large (the POST data, for example)
  • The request header is too large (for example, if you send a huge cookie value)

For example, freecurrencyapi.com will return a 429 error status code when you have reached your monthly quota limit.

These are common API error codes, along with their corresponding use cases.

API error codes are used by APIs to communicate errors to their users. There are many standardized API error codes, and they’re often defined in the OpenAPI Specification (OAS) — a file that describes the structure of an API. For example, if you attempt to make a call that doesn’t exist or is invalid, you might receive a 404 error code. This means that the requested resource could not be found on this server. In addition to these everyday use cases for API errors, there are also less-common ones which we’ll explore below.

Conclusion

The examples above are just a few of the most common error codes you’ll find in the wild. There are many others that we didn’t have time to cover here. Developers need to understand how these work and when they’re appropriate to avoid bad experiences with their users.

Tweet54SendShare15
Previous Post

Dunkin’ Halloween donuts turn out to be a ‘trick in treat’ experience for customers

Next Post

Bitcoin Now Less Volatile Than S&P 500, Nasdaq for First Time Since 2020

Rohan Mathawan

Content Editor at Techstory Media | Technology | Gadgets | Written more than 5000+ articles about different niches from Tech to online real money gaming for reputed brands and companies. Get in touch Email: [email protected] For Business Enquires related to TechStory [email protected]

Recommended For You

Weekly Tech News – First Week of May 2025

by Thomas Babychan
May 12, 2025
0
Weekly Tech News – First Week of May 2025

India’s technology sector experienced several key developments this week, ranging from global manufacturing shifts and payment infrastructure milestones to renewable energy commitments and cybersecurity concerns. These updates not...

Read more

JustDeliveries Raises ₹5.5 Cr to Redefine Cold Chain Logistics in India

by Ishaan Negi
May 12, 2025
0
JustDeliveries Raises ₹5.5 Cr to Redefine Cold Chain Logistics in India

In a significant boost to India's food and beverage (F&B) logistics ecosystem, JustDeliveries, a new-age cold chain logistics startup, has raised ₹5.5 crore in fresh funding.

Read more

Mittal’s Airtel Eyes 49% Stake in Haier India; Reliance, Dabur Not Far Behind

by Ishaan Negi
May 12, 2025
0
Mittal’s Airtel Eyes 49% Stake in Haier India; Reliance, Dabur Not Far Behind

The creator of telecom behemoth Bharti Airtel, Sunil Bharti Mittal, is allegedly in advanced negotiations to purchase a 49% share in Haier Smart Home India for almost $2...

Read more
Next Post
Crypto Winter upsets Genesis

Bitcoin Now Less Volatile Than S&P 500, Nasdaq for First Time Since 2020

Please login to join discussion

Techstory

Tech and Business News from around the world. Follow along for latest in the world of Tech, AI, Crypto, EVs, Business Personalities and more.
reach us at [email protected]

Advertise With Us

Reach out at - [email protected]

BROWSE BY TAG

#Crypto #howto 2024 acquisition AI amazon Apple bitcoin Business China cryptocurrency e-commerce electric vehicles Elon Musk Ethereum facebook flipkart funding Gaming Google India Instagram Investment ios iPhone IPO Market Markets Meta Microsoft News NFT samsung Social Media SpaceX startup startups tech technology Tesla TikTok trend trending twitter US

© 2024 Techstory.in

No Result
View All Result
  • News
  • Crypto
  • Gadgets
  • Memes
  • Gaming
  • Cars
  • AI
  • Startups
  • Markets
  • How to

© 2024 Techstory.in

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?