Course contentsShow
← Web Development
Lesson 1471 of 2,98227. REST API Design for FrontendFree lesson

Resources and Resource Identifiers

How REST organizes data as resources with unique URIs that represent entities in your application.

Resources and Resource Identifiers

You'll learn how REST treats every piece of data in your application as a uniquely addressable resource with its own URI.

The Core Idea

In REST architecture, everything is a resource—a noun representing an entity in your system. Instead of thinking about actions or functions, you organize your API around things: users, products, orders, comments. Each resource gets a unique URI (Uniform Resource Identifier) that serves as its address on the web.

Think of resources like houses on a street. Each house (resource) has a unique street address (URI) that lets you find it. You don't say "get the data from the user table where id=5"—you simply go to the address /users/5.

Resource Examples

A resource can be:

  • A single entity: /users/42 (one specific user)
  • A collection: /users (all users)
  • A nested relationship: /users/42/orders (orders belonging to user 42)
  • Any conceptual entity: /search, /dashboard, /settings

URI Structure Conventions

URIs should be:

  • Nouns, not verbs: /products not /getProducts
  • Plural for collections: /articles not /article
  • Hierarchical when related: /authors/7/books/3 shows book 3 by author 7
  • Lowercase with hyphens: /product-categories not /ProductCategories

Why This Matters

By identifying resources with URIs, you create a predictable, intuitive API structure. Developers can guess that if /users/5 gets one user, then /products/12 probably gets one product. This consistency makes APIs self-documenting and easier to understand.

Key Takeaway: REST organizes your application's data as resources, each identified by a unique URI that acts as a stable, meaningful address for accessing that entity.