PaperDB.io API
We have made a JSON webservice API. The API have a set of auxilery endpoints for getting entities from our system. Typically these auxilery endpoints is used to populate a UI for the user to filter out a set of papers. Beside the auxilery endpoints we have two endpoints for querying the PaperDB. One for getting a list of papers and one for getting a detailed description of a paper entity.
All methods accepts a UserId token for authorization purpose.
Authentication endponts:
- /user/authenticate:Authenticate user against DB and returns a JWT
Auxilery endpoints:
- /GetArchtype:Gets all archtypes sorted by archtype name.
- /GetSuppliers:Gets all suppliers sorted by supplier name.
Paper endpoints:
- /listPapersByQuery:Gets a list of papers based on query object. Returns ”paper name + weight” and an ID.
- /GetPaperById:Returns a paper object with specified ID. .
Endpoint |
/user/authenticate |
Method |
Post |
Description |
Returns a JWT with information about the logged in user |
input:
Username |
String |
Mandatory |
Password |
String |
Mandatory |
output:
EndPoint |
Get Archtypes |
Method |
Get |
Description |
Returns a list of archtypes names and ids |
Input
Output
Archtypes |
[archtype:id, Name] |
Endpoint |
GetSuppliers |
Method |
Get |
Description |
Returns a list of supplier name and ids |
Input
Output
Suppliers |
[Supplier: Id, Name] |
|
Endpoint |
ListPapersByQuery |
Method |
Post |
Description |
Returns a list of Papers Based on a query |
Input
Token |
JWT |
Mandatory |
OrderBy |
[string] |
Optional |
Page |
Int |
Optional |
PageSize |
Int |
Optiona,(Max:100) |
Query |
[Object(JSON)] |
Optional |
Output
Papers |
[paper: Id,Name] |
|
CurrentPage |
Int |
|
PageSize |
Int |
|
TotalPages |
Int |
|
TotalCnt |
Int |
|
Description
The query Object is an array of json object. The json object contains a fieldname, an Operator and a value.
- Fields are:
- Archtype,
- Supplier,
- Brand,
- Grammage,
- Whiteness,
- Opacity,
- Thickness,
- Bulk,
- Whiteness,
- Brightness,
Operators are:
- eq:Equal
- ne:Not Equal
- gt:Greater than
- gte: greater than or equal to
- lt:Less than
- lte:Less than or equal to
- lk:Like-like(value%)
- lkg:Like greedy-like(%value%)
Endpoint |
GetPaperById |
Method |
Post |
Description |
Returns a paper Object with all fields |
Input
Token |
JWT |
Mandatory |
Id |
Int |
Mandatory |
Output