A URI is a Universal Resource Identifier, identifying where a specific resource can be found, such as a page or a document. They are used in REST APIs to address resources to developers using an API. You may have seen URIs, URLs, and URNs in networking discussions before, but how do we tell them apart?
A URI is an identifier with syntax that looks like this: `scheme:[//authority]path[?query][#fragment]`. Let's have a look at the parts of the URI.
URIs are common resource locations in REST APIs, so naming them descriptively is considered a best practice. A developer using your REST API may not know what a resource does or what it contains, so naming it a string of letters and numbers is not helpful to them. Consider naming it descriptively, for example, `http://api.example.com/louvre/leonardo-da-vinci/mona-lisa`. This follows the URI syntax above, while giving new users a clear path to follow.
URIs and URLs can be difficult to keep distinct in your mind. Here's what it boils down to: All URLs are URIs, but not all URIs are URLs. This is because URLs define how to access a resource in addition to its location, while URIs are only a string identifier for a resource location. We hope this helps!