Update book by Book ID.

PUT /api/v1/books/{id}

Path parameters

  • id string Required

    Book ID.

multipart/form-data

Body

  • id string Required

    The ID of the book.

  • title string Required

    The title of the book.

  • author string Required

    The author of the book.

  • description string

    The description of the book.

  • language string Required

    The language of the book.

  • condition string Required

    The condition of the book.

  • genres array[string] Required

    The genres of the book.

  • coverPhotos array[string(binary)] Required

    The cover photos of the book.

  • swapCondition string Required

    Swap condition of the book in JSON format.

Responses

  • 401 */*

    Unauthorized

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 404 */*

    Not Found

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 500 */*

    Internal Server Error

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 400 */*

    Bad Request

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 200 */*

    Book updated.

    Hide response attributes Show response attributes object
    • id string
    • title string
    • author string
    • genres array[string]
    • language string
    • description string
    • condition string
    • coverPhotoUrls array[string]
    • owner object
      Hide owner attributes Show owner attributes object
      • id string
      • name string
    • swapCondition object
      Hide swapCondition attributes Show swapCondition attributes object
      • swapType string
      • giveAway boolean
      • openForOffers boolean
      • swappableGenres array[object]
        Hide swappableGenres attributes Show swappableGenres attributes object
        • id string
        • name string
      • swappableBooks array[object]
        Hide swappableBooks attributes Show swappableBooks attributes object
        • id string
        • title string
        • author string
        • coverPhotoUrl string
PUT /api/v1/books/{id}
curl \
 --request PUT 'http://localhost:8080/api/v1/books/{id}' \
 --header "Content-Type: multipart/form-data" \
 --form "id=123456" \
 --form "title=The Alchemist" \
 --form "author=Paulo Coelho" \
 --form "description=A novel by Paulo Coelho" \
 --form "language=English" \
 --form "condition=New" \
 --form "genres[]=Fiction" \
 --form "coverPhotos[]=book-cover-photo.jpg" \
 --form 'swapCondition={"books":[{"title":"The Alchemist","author":"Paulo Coelho","coverPhoto":"swappable-book-cover-photo.jpg"}],"genres":[],"giveAway":false,"conditionType":"ByBooks","openForOffers":false}'
Response examples (401)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (404)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (500)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (400)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (200)
{
  "id": "string",
  "title": "string",
  "author": "string",
  "genres": [
    "string"
  ],
  "language": "string",
  "description": "string",
  "condition": "string",
  "coverPhotoUrls": [
    "string"
  ],
  "owner": {
    "id": "string",
    "name": "string"
  },
  "swapCondition": {
    "swapType": "string",
    "giveAway": true,
    "openForOffers": true,
    "swappableGenres": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "swappableBooks": [
      {
        "id": "string",
        "title": "string",
        "author": "string",
        "coverPhotoUrl": "string"
      }
    ]
  }
}