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. CRUD (Admin)
  • 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
        • Get a client by ID
          GET
        • Update a client
          PUT
        • Delete a client
          DELETE
    • 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 a category by ID
      • Add a new category
      • Update a category
      • Delete a category
  1. CRUD (Admin)

Update a client

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

@access Admin#

Request

Path Params
id
string 
required
Example:
67b0bc194c6004ef32096703
Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTcxMTcwMiwiZXhwIjoxNzM5Nzk4MTAyfQ.EfmX3rKOQ-Dafn_kskStpd2Zlk7NK8Evz_ZCpLFm7x8
Body Params application/json
nom
string 
optional
email
string 
optional
adresse
string 
optional
Example
{
  "nom": "Leslie Larkin",
  "adresse": "36611 S Market Street"
}

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/clients/67b0bc194c6004ef32096703' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTcxMTcwMiwiZXhwIjoxNzM5Nzk4MTAyfQ.EfmX3rKOQ-Dafn_kskStpd2Zlk7NK8Evz_ZCpLFm7x8' \
--header 'Content-Type: application/json' \
--data-raw '{
    "nom": "Leslie Larkin",
    "adresse": "36611 S Market Street"
}'

Responses

🟢200Success
application/json
Body
success
boolean 
required
message
string 
required
data
object 
required
client
object 
required
Example
{
  "success": true,
  "message": "Client updated successfully!",
  "data": {
    "client": {
      "_id": "qJ6UuH-n7OkDlWOQJCWce",
      "nom": "Carol Parisian",
      "email": "Garret_Harvey@hotmail.com",
      "adresse": "79687 Wanda Pines",
      "role": "client"
    }
  }
}
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Previous
Get a client by ID
Next
Delete a client
Built with