-
Notifications
You must be signed in to change notification settings - Fork 0
Quoter v2 API
Quoter/v2 is the second version of quoter API created to get, store and add new quotes. It's supports next operations on quotes list:
- Separating by different repositories (resolvers).
- Adding new quote to repository by PUT request.
- Getting all quotes from repository.
- Getting quote by ID from repository.
- Getting range of quotes IDs from repo.
- Getting random quote from repo.
- Search by field(s) in repository.
- Editing quote by field(s) in repo.
Quoter/v2 endpoints are located at http(s)://<host>:<port>/api/v2/quote/
base url.
All requests that require body parameters are accepts only JSON formatted body.
Server respond Bad Request
if there're some fields are required but not specified in request or have invalid format.
Internal Server Error
fires only when there's an unexpected exception has occurred while processing your request. It may be caused by your wrong params (shit happens) or undefined state of database (big shit also happens).
Endpoint: /all
Method: GET
Required path parameters: resolver
ex. /all?resolver=test
Required body parameters: None
Returns: JSON array of quote objects.
Special status codes: None
Endpoint: /<id>
where id
is an positive integer greater than zero
Method: GET
Required path parameters: resolver
ex. /12?resolver=test
Required body parameters: None
Returns: JSON-formatted quote object.
Special status codes:
-
404, Not Found
if quote with specified ID doesn't exists in this repo.
Endpoint: /<from>/<to>
where from
and to
such positive integers greater than zero that to >= from
Method: GET
Required path parameters: resolver
ex. /120/122?resolver=test
Required body parameters: None
Returns: JSON array of quote objects.
Special status codes:
-
400, Bad Request
including common reasons,Bad Request
also fires if specified valuesto < from
Notes:
If specified
to == from
API will return single quote (if it's exists).
Range
from
to
is inclusive on both sides