Gestion de Bibliotique
Home
API
  • Client > Authentification
  • Client > Profile
  • Client > CRUD
  • Livres
  • Emprunts
  • Categories
Team
  • Nassim MZILI
  • Abderrahim El Ouali
Home
API
  • Client > Authentification
  • Client > Profile
  • Client > CRUD
  • Livres
  • Emprunts
  • Categories
Team
  • Nassim MZILI
  • Abderrahim El Ouali
GitHub
GitLab
  1. Livres
  • Get Started
  • API
    • Clients
      • Auth
        • Register a new client
        • Login a client
        • Logout a client
      • Profile
        • Update client profile
        • Update client password
        • Get client details
        • Get all emprunts for a client
      • CRUD (Admin)
        • Get all clients
        • Get a client by ID
        • Update a client
        • Delete a client
    • Livres
      • Get all books
        GET
      • Get a book by ID
        GET
      • Add a new book
        POST
      • Update a book
        PUT
      • Delete a book
        DELETE
    • Emprunts
      • Create a new emprunt
      • Get emprunt by ID
      • Update an emprunt
      • Delete an emprunt
      • Get all emprunts
      • Get all emprunts for a specific client
      • Return a book
    • Categories
      • Get all categories
      • Get a category by ID
      • Add a new category
      • Update a category
      • Delete a category
  1. Livres

Update a book

PUT
https://gestion-bibliotique-pfe.netlify.app/api/livres/{id}
Maintainer:Nassim MZILI

@access Admin#

Request

Path Params
id
string 
required
Example:
67b39c39edebf1cf9588b585
Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTgyMzk4MCwiZXhwIjoxNzM5OTEwMzgwfQ.MmWJHgXj1btOWfnJA13qKIeLG2hWzkRLzX4xcfBs4QM
Body Params application/json
isbn
string 
optional
titre
string 
optional
auteur
string 
optional
anneePublication
integer 
optional
>= 1900<= 2025
editeur
string 
optional
langue
string 
optional
description
string 
optional
quantite
integer 
optional
>= 0
Multiple of:
100
Example
{
  "titre": "aliquid quos alioqui",
  "anneePublication": 2022,
  "langue": "Anglais"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://gestion-bibliotique-pfe.netlify.app/api/livres/67b39c39edebf1cf9588b585' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTgyMzk4MCwiZXhwIjoxNzM5OTEwMzgwfQ.MmWJHgXj1btOWfnJA13qKIeLG2hWzkRLzX4xcfBs4QM' \
--header 'Content-Type: application/json' \
--data-raw '{
    "titre": "aliquid quos alioqui",
    "anneePublication": 2022,
    "langue": "Anglais"
}'

Responses

🟢200Success
application/json
Body
success
boolean 
required
message
string 
required
data
object 
required
livre
object (Livre) 
required
Example
{
  "success": true,
  "message": "Book updated successfully!",
  "data": {
    "livre": {
      "_id": "ocUxgFeH7w1fjn9TI_Ses",
      "isbn": "978-1-55259-339-4",
      "titre": "comes officiis texo",
      "auteur": "Martin Hayes",
      "editeur": "solus consequuntur vigilo",
      "langue": "Russe",
      "description": "Auctus et audax itaque viduo. Coniuratio ara incidunt cupiditas viriliter. Aperiam vesica conventus cum.",
      "quantite": 91,
      "anneePublication": 1954
    }
  }
}
🟠404Record Not Found
🟠401Unauthorized
🟠403Forbidden
🔴500Server Error
Previous
Add a new book
Next
Delete a book
Built with