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. Categories
  • 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 a book by ID
      • Add a new book
      • Update a book
      • Delete a book
    • 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
      • Get a category by ID
        GET
      • Add a new category
        POST
      • Update a category
        PUT
      • Delete a category
        DELETE
  1. Categories

Update a category

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

@access Admin#

Request

Path Params
id
string 
required
Example:
67ba8aac0e66a24f3491b65e
Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjM5ODM0NTc1N2EyYTY4MWU5Njc4OSIsInJvbGUiOiJjbGllbnQiLCJpYXQiOjE3NDAyNzc0NjIsImV4cCI6MTc0MDM2Mzg2Mn0.fnnI0u86yQMPIKWghW2pxOHwjzmp0mjnO6spNZUjnsM
Body Params application/json
nom
string 
optional
description
string 
optional
Example
{
  "nom": "conculco",
  "description": "Illo officiis coerceo aequitas ara. Aggredior sit validus. Exercitationem cubicularis fugiat."
}

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/categories/67ba8aac0e66a24f3491b65e' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjM5ODM0NTc1N2EyYTY4MWU5Njc4OSIsInJvbGUiOiJjbGllbnQiLCJpYXQiOjE3NDAyNzc0NjIsImV4cCI6MTc0MDM2Mzg2Mn0.fnnI0u86yQMPIKWghW2pxOHwjzmp0mjnO6spNZUjnsM' \
--header 'Content-Type: application/json' \
--data-raw '{
    "nom": "conculco",
    "description": "Illo officiis coerceo aequitas ara. Aggredior sit validus. Exercitationem cubicularis fugiat."
}'

Responses

🟢200Success
application/json
Body
success
boolean 
required
message
string 
required
data
object 
required
categorie
object (Categorie) 
required
Example
{
  "success": true,
  "message": "Category updated successfully!",
  "data": {
    "categorie": {
      "_id": "033vnqi2T7KX8WLt_Wlcy",
      "nom": "versus",
      "description": "Pecto denuo patior vespillo canonicus cohaero. Cito coniuratio copia taceo. Totus theca advoco."
    }
  }
}
🟠404Record Not Found
🟠401Unauthorized
🟠403Forbidden
🔴500Server Error
Previous
Add a new category
Next
Delete a category
Built with