API Resource
- Last UpdatedJun 13, 2024
- 1 minute read
API Resource
The complete path where information can be accessed or operated within an API.
Example:
API Resource: /mysite/operational-status, /shopping-cart/item/1/info, /api/v1/employee/12312/status
API Resource = URL-Path
For RESTful APIs, a resource contains "basePath" and "Path".
basePath
A logical entity that groups resources pertaining to a similar version of an implementation, a similar code base within an implementation, or a similar feature within the product.
Path
The logical location after the basePath where the resource is accessible.
Example
With reference to the examples described in API Resource.
API Resource |
basePath |
Path |
---|---|---|
/mysite/operational-status |
/ |
/mysite/operational-status |
/shopping-cart/item/1/info |
/shopping-cart |
/item/1/info |
/api/v1/employee/12312/status |
/api/v1/employee |
/12312/status |
Hence, API Resource = basePath + Path
It is important to note that an API Resource does not describe anything about the location (i.e. the host or the server). At the same time, an API Resource is not referred to by itself and is always used in conjunction with the definition of an API or an API specification which incorporates the host or the server details.
Hence, when using API Resource by itself it means the following:
API Resource = API Host, basePath + Path
Example
API Host |
API Resource |
basePath |
Path |
---|---|---|---|
api.imperva.com |
/mysite/operational-status |
/ |
/mysite/operational-status |
mysite.mycompany.com |
/api/v1/employee/12312/status |
/api/v1/employee |
/12312/status |