The following document describes the endpoints implemented for this exercise and it's resources. You can test the endpoints against https://auth0-exercise-quotes-api.herokuapp.com/.
For any questions on this document please refer to the assigned slack channel at Auth0's chat.
The quotes
collection is formed by objects of the following format:
const QuoteSchema = {
"id": Number(),
"authorName": String(),
"text": String()
}
-
authorName
: Performs a case insensitive contains search by this property.Example:
GET /api/quotes?authorName=AlBeRt
-
text
: Performs a case insensitive contains search by this quote property.Example:
GET /api/quotes?text=wAnT
-
sortBy
: CSV of valid properties of quotes (except forid
).Example:
GET /api/quotes?sortBy=-authorName,text
page
: Numeric value representing the currently chunk of results returned. Default:1
. Min:1
. Max: not specified.pageSize
: Numeric value representing the amount of results returned per page. Default:10
. Min:1
. Max:50
.
const ResponseSchema = {
results: [QuoteSchema], // matched results per query
pagination: {
page: Number(), // returned `page` number of request
pageSize: Number(), // returned `pageSize` of the request
pageCount: Number(), // total count of pages for query
rowCount: Number(), // total number of rows (elements) for query
}
}
The quotes
collection is formed by objects of the following format:
const QuoteSchema = {
"id": Number(),
"authorName": String(),
"text": String()
}
id
: The numeric id of thequote
requested. This will make anexact
match on db by theid
provided and return that element only.
const ResponseSchema = QuoteSchema;