The following document describes the endpoints implemented for this exercise and it's resources. You can test the endpoints against https://acf-ts-quotes-api.ondigitalocean.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:
interface 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
.
type 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:
interface 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;