> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/asp-net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/asp-net/chapter3rest-api-design-development-and-management/33designing-rest-api/332practices-for-resource-names-actions-and-associations.md).

# 3.3.2.Practices for Resource Names, Actions & Associations

![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0XcmFVyY1G7njS4A%2F201803174.jpg?generation=1586302966252934\&alt=media)

* Resource Identity
  * API endpoint or URL for the resource   &#x20;
    * 1.**Avoid using your www domain** for API e.g., <http://www.acme.com>
    * 2.Keep your base URL simple
    * 3.If possible use a subdomin e.g., <https://api.twitter.com>
    * 4.Or/And use seperate domain e.g., <https://api.walmartlabs.com>
* Resource names
  * Use **nouns** to identify the resources
  * Use of **Plural** is suggested
    * e.g., Walmart: /items, /items/{id}
    * e.g., Linkedin: /people, /people/{id}
  * Do not use verbs for resources
    * e.g., Do not use /getVacationPackages
    * GET <http://api.acme.com/vacations>
    * GET, PUT, DELETE, POST <http://api.acme.com/vacations/{id}>
* Action
  * Action operation != CRUD
  * OK to use action as part of resource hirarchy e.g., /friendships/lookup
  * Or create an action with subquery e.g., /search?query
* Associations
  * Resources contain other resources
  * e.g.,
    * Facebook /me/photo
    * Walmart Items/{id}/reviews
    * Twitter mutes/users/list
  * Avoid deep nesting (Maximum = 3 suggested)
  * Use subquery to avoid deep nesting
