Add patron or staff info (v0.1)

http://localhost:9130

Table of contents

API for adding patron or staff info

Add info API

/circulation/loans/{id}/add-info

POST /circulation/loans/{id}/add-info

POST /circulation/loans/{id}/add-info
URI Parameters
  • id: required (string)
Body

Media type: application/json

Type:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request body schema for API for adding staff or patron info",
  "properties": {
    "action": {
      "description": "They category of info added",
      "type": "string",
      "enum": [
        "staffInfoAdded",
        "patronInfoAdded"
      ]
    },
    "actionComment": {
      "description": "Free text info",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "action",
    "actionComment"
  ]
}

Response 201

Patron or staff info has been successfully added

Response 404

The loan is not found

Response 422

Unable to add patron or staff info 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" : "An action of type 'patronInfoAdded' or 'staffInfoAdded', with associated 'actionComment', required in order to add info",
    "parameters" : [ {
      "key" : "action",
      "value" : "patronInfoAdded"
    } ]
  } ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator