Change usage status of items to be used at location (ie reading room) (v0.1)

http://localhost:9130

Table of contents

API for changing usage status of items used at location

Change usage status API

/circulation

POST /circulation/hold-by-barcode-for-use-at-location

POST /circulation/hold-by-barcode-for-use-at-location
Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to switch status of use at location to 'Held'",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item being in use at location",
      "type": "string"
    }
  },
  "required": [
    "itemBarcode"
  ]
}

Response 200

The at-location usage status of the loaned item set to held

Response 404

The loan is not found

Response 422

Unable to change the usage status for the loan

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "TBD",
      "parameters": [
        {
          "key": "itemId",
          "value": "91719676-e7b5-4f83-bdab-cb70dd10c1e3"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /circulation/pickup-by-barcode-for-use-at-location

POST /circulation/pickup-by-barcode-for-use-at-location
Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request to switch status of use at location to 'In use'",
  "properties": {
    "itemBarcode": {
      "description": "Barcode of the item lent to the patron for use at location",
      "type": "string"
    },
    "userBarcode": {
      "description": "Barcode of the user (representing the patron)",
      "type": "string"
    }
  },
  "required": [
    "itemBarcode",
    "userBarcode"
  ]
}

Response 200

The at-location usage status of the loaned item set to in-use

Response 404

The loan is not found

Response 422

Unable to change the usage status for the loan

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "TBD",
      "parameters": [
        {
          "key": "itemId",
          "value": "91719676-e7b5-4f83-bdab-cb70dd10c1e3"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator