Rapid Profile picture
Jan 3, 2022 8 tweets 3 min read Read on X
REST APIs use Uniform Resource Identifiers (URI) to access resources.

Good URIs and well-named resources make your API feasible and intuitive.

Here are a few tips that can help you. 🧵
1️⃣ Use of nouns in URIs

REST APIs are used to get and manipulate resources that are information (nouns), not actions (verbs).

In simple terms, REST URIs should not indicate CRUD (Create, Read, Update, Delete) functionality.

For example 👇🏻
2️⃣ Use forward-slash (/)

Use forward-slash (/) special character to indicate the hierarchy relationship between resources.

This will increase the readability of URIs and hence increase the adoption of API.
3️⃣ Use hyphens (-) instead of underscores ( _ )

There is nothing wrong with using underscores, but hyphens reduce chaos as underscores are sometimes not readable due to fonts or browsers.
4️⃣ Don't use file extensions

File extensions don't serve any additional features. They simply increase the length of URI and hence decrease the readability of endpoints.
You can use the `Content-Type` header to indicate the media type of a particular file, if necessary.
5️⃣ Use query parameters

Do not create a separate endpoint for a specific resource. Instead, enable sorting based on certain attributes.

For example 👇🏻
With that being said, these are five tips that can help you increase your API's adoption.

Don't forget to publish your API on RapidAPI Hub (RapidAPI.com/hub?utm_source…) and make it accessible to over 3 million developers.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Rapid

Rapid Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Rapid_API

Apr 24, 2023
Common REST API challenges.

A thread 🧵
REST APIs adhere to REST(Representational State Transfer) architecture, which comprises several rules that define scalable and lightweight API design.

Here are the biggest challenges faced when working with them 👇
1️⃣ Security

APIs are integral to businesses on today’s web and require protection from attackers.

Security methods include encryption, API Keys, OAuth, input validation, error handling, and more.

Security is a deep topic. Check out the OWASP API security guides to know more.
Read 7 tweets
Apr 24, 2023
HTTP headers for CORS explained.

A thread 🧵👇
Let's start with HTTP request headers:

📌 Origin

The browser adds this header to CORS requests to indicate the origin domain.
📌 Access-Control-Request-Method

Specific CORS requests that affect user data will initiate with a preflight request. This header is added to the preflight to indicate the method used in the main request. For example:

Access-Control-Request-Method: PUT
Read 10 tweets
Apr 24, 2023
10 HTTP headers that developers should be aware of.

Thread🧵👇
1️⃣ Accept

A client-side header that defines the type of data the client expects from the server.

This means the server won’t waste time returning a data type the client cannot use.
2️⃣ Authorization

A client-side header that passes the credentials to the server.

This is not the same as authentication. The server can only authenticate the user after it checks the authorization credentials.
Read 12 tweets
Apr 21, 2023
API. What is it?

- What is an API
- Usage of APIs
- Types of APIs
- Benefits of APIs

Thread 🧵👇
📌 Application Programming Interface (API)

APIs are a set of protocols, routines, and tools that enable software to communicate with each other.

They allow developers to access and use the functionality of another system without having to understand its inner workings.
For example, when you use a weather app on your phone, it likely relies on an API to retrieve data from a weather service.

The app developers don't need to know how the weather service works internally. They just need to use its API to get the data they need.
Read 8 tweets
Apr 21, 2023
What is the difference between URI, URL, and URN?

A Thread 🧵👇
📌 URI

URL (Uniform Resource Identifier) is a unique string of characters used to identify resources on the web.

Typical URIs contain various elements such as a path, authority, query, and fragment. They are structured like this:

scheme:[//authority]path[?query][# fragment]
URIs are only able to identify resources on the internet and not locate them.

Because of this, they are not seen very frequently on the web.
Read 10 tweets
Apr 21, 2023
What is an API?

Thread 🧵👇

{ 1 / 5 } What is an API?
{ 2 / 5 } The API call is initiated. ...
{ 3 / 5 } Our worker ant acts like an...
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(