You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All you can find in our API Rest is information about users, loans, fines (penalties), resources, types, copies and genres. All you need to do is simply; you have to follow the API rules. If you try to do following a different way, it's probably what you will recieve an error.
You only can send GET, POST, PUT and DELETE requests.
Our API has a public side where you can make very simple requests. If you want to make other type of requests (take a look at your profile, your loans...), you have to log in before try it.
Once you are logged in (or not) you can send many requests as you want (always following our rules).
If you want to finish your session, just log out from the API.
API requests
Resources
Resources API has GET(2), POST(1), PUT(1) and DELETE(1) methods. Like an unregistered user, you only are allowed to send GET requests. Like a registered user, you only are allowed to send GET requests too. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
GET methods
Type
Request description
Request URL
Success response
Error response
1
Shows all resources (you can apply optional filters like genre and type).
Users API has GET(2), POST(1), PUT(1) and DELETE(1) methods. Like an unregistered user, you are allowed to send POST requests. Like a registered user, you only are allowed to send an unique GET request which shows to you information about your account. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
Loans API has GET(2), POST(1), PUT(1) and DELETE(1) methods. Like an unregistered user, you are not allowed to send requests. Like a registered user, you only are allowed to send GET requests which shows to you information about your loans. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
Fines API has GET(2) and DELETE(1) methods. Like an unregistered user, you are not allowed to send requests. Like a registered user, you only are allowed to send GET requests which shows to you information about your fines. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
GET methods
Type
Permissions
Request description
Request URL
Success response
Error response
1
Admin
Shows all fines.
/api/fines
Fine list and OK (200).
NOT_FOUND (404)
2
Admin
Shows a determinated fine.
/api/fines/id
Fine and OK (200).
NOT_FOUND (404)
3
User
Shows all user's fines.
/api/fines
Fine list and OK (200).
NOT_FOUND (404)
4
User
Shows information about your fine.
/api/fines/id
Fine and OK (200).
NOT_FOUND (404)
DELETE method
Type
Request description
Request URL
Success response
Error response
1
Deletes a fine.
/api/fines/id
Deleted fine and OK (200)
CONFLICT (409) or NOT_FOUND (404)
Genres
Genres API has GET(2), POST(1), PUT(1) and DELETE(1) methods. Like an unregistered user, you only are allowed to send GET requests. Like a registered user, you only are allowed to send GET requests too. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
GET methods
Type
Request description
Request URL
Success response
Error response
1
Shows all genres.
/api/genres
Genre list and OK (200).
NOT_FOUND (404)
2
Shows a determinated genre.
/api/genres/id
Genre and OK (200).
NOT_FOUND (404)
POST method
Type
Request description
Request URL
Request body
Success response
Error response
1
Creates a new genre.
/api/genres
See below
New genre and CREATED (201)
BAD_REQUEST (406)
Type 1 method Request body:
{
"name": newGenreName
}
DELETE method
Type
Request description
Request URL
Success response
Error response
1
Deletes a genre.
/api/genre/id
Deleted genre and OK (200)
CONFLICT (409) or NOT_FOUND (404)
PUT method
Type
Request description
Request URL
Request body
Success response
Error response
1
Modifies an existing genre.
/api/genres/id
See below
Modified genre and OK (200)
NOT_FOUND (404)
Type 1 method Request body (example using id 1)
{
"id": 1,
"name": modifiedGenreName,"resources": [
{
"id": 1,
"title": "Cien años de soledad",
"author": "Gabriel García Márquez",
"editorial": "Editorial Sudamericana",
"picture": "1.jpg",
"noReservedCopies": [
"1GaCi3"
],
"avaiblereserve": true,
"description": "Cien años de soledad es..."
},
{
"id": 5,
"title": "Logia",
"author": "Francisco Ortega",
"editorial": "Planeta",
"picture": "5.jpg",
"noReservedCopies": [
"5FrLo9"
],
"avaiblereserve": true,
"description": "La historia narra las..."
}
]
}
Resource types
Resource types API has GET(2), POST(1), PUT(1) and DELETE(1) methods. Like an unregistered user, you only are allowed to send GET requests. Like a registered user, you only are allowed to send GET requests too. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.
GET methods
Type
Request description
Request URL
Success response
Error response
1
Shows all resource types.
/api/resourcetypes
Resource type list and OK (200).
NOT_FOUND (404)
2
Shows a determinated resource type.
/api/resourcetypes/id
Resource type and OK (200).
NOT_FOUND (404)
POST method
Type
Request description
Request URL
Request body
Success response
Error response
1
Creates a new resource type.
/api/resourcetypes
See below
New resource type and CREATED (201)
BAD_REQUEST (406)
Type 1 method Request body:
{
"name": newResourceTypeName
}
DELETE method
Type
Request description
Request URL
Success response
Error response
1
Deletes a resource type.
/api/resourcetypes/id
Deleted resource type and OK (200)
CONFLICT (409) or NOT_FOUND (404)
PUT method
Type
Request description
Request URL
Request body
Success response
Error response
1
Modifies an existing resource type.
/api/resourcetypes/id
See below
Modified resource type and OK (200)
NOT_FOUND (404)
Type 1 method Request body (example using id 1)
{
"id": 1,
"name": modifiedResourceTypeName
}
Resource copies
Resource copies API has GET(2), POST(1), PUT(1) and DELETE(1) methods. you are not allowed to send requests. Like a registered user, you only are allowed to send GET requests. Like an administrator user, you are allowed to send any request.
All Request URLs can be send by typing http://localhost:8443 followed by the request URL containt in the following tables.