Request Policy Storage (v1.0)

http://localhost:9130

Table of contents

Request Policy Storage API

Storage for request policies

/request-policy-storage

GET /request-policy-storage/request-policies

Retrieve a list of request-policy items.

GET /request-policy-storage/request-policies
Query Parameters
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    searchable using CQL

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    id="cf23adf0-61ba-4887-bf82-956c4aae2260"
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of request-policy items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of request policies",
  "type": "object",
  "properties": {
    "requestPolicies": {
      "description": "List of request policies",
      "id": "requestPolicies",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-policy.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "requestPolicies",
    "totalRecords"
  ]
}

Example:

{
  "requestPolicies": [
    {
      "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
      "name": "Example Request Policy",
      "description" : "Description of request policy",
      "requestTypes" : ["Hold", "Page"]
    },
    {
      "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177232",
      "name": "Example Recall Request Policy",
      "description" : "Description of request policy",
      "requestTypes" : ["Recall"]
    },
    {
      "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177233",
      "name": "Example all-request-types Request Policy",
      "description" : "Description of request policy",
      "requestTypes" : ["Hold", "Page", "Recall"]
    }
  ],
  "totalRecords": 3
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list request-policies -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list request-policies -- unauthorized

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /request-policy-storage/request-policies

Create a new request-policy item.

POST /request-policy-storage/request-policies
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "request policy schema",
  "properties": {
    "id": {
      "description": "Unique request policy ID",
      "type": "string"
    },
    "name": {
      "description": "Unique request policy name, required",
      "type": "string"
    },
    "description": {
      "description": "Description of request policy",
      "type": "string"
    },
    "requestTypes": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-type.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description" : "Description of request policy",
  "requestTypes" : ["Hold", "Page"]
}

Response 201

Request policy created

Headers
  • Location: required (string)

    URI to the created request-policy item

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "request policy schema",
  "properties": {
    "id": {
      "description": "Unique request policy ID",
      "type": "string"
    },
    "name": {
      "description": "Unique request policy name, required",
      "type": "string"
    },
    "description": {
      "description": "Description of request policy",
      "type": "string"
    },
    "requestTypes": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-type.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description" : "Description of request policy",
  "requestTypes" : ["Hold", "Page"]
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add request-policy -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create request-policies -- unauthorized

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

DELETE /request-policy-storage/request-policies

DELETE /request-policy-storage/request-policies
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

All request policies deleted

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

GET /request-policy-storage/request-policies/{requestPolicyId}

Retrieve request-policy item with given {request-policyId}

GET /request-policy-storage/request-policies/{requestPolicyId}
URI Parameters
  • requestPolicyId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Request policy successfully retreived

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "request policy schema",
  "properties": {
    "id": {
      "description": "Unique request policy ID",
      "type": "string"
    },
    "name": {
      "description": "Unique request policy name, required",
      "type": "string"
    },
    "description": {
      "description": "Description of request policy",
      "type": "string"
    },
    "requestTypes": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-type.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description" : "Description of request policy",
  "requestTypes" : ["Hold", "Page"]
}

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

PUT /request-policy-storage/request-policies/{requestPolicyId}

Update request-policy item with given {request-policyId}

PUT /request-policy-storage/request-policies/{requestPolicyId}
URI Parameters
  • requestPolicyId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "request policy schema",
  "properties": {
    "id": {
      "description": "Unique request policy ID",
      "type": "string"
    },
    "name": {
      "description": "Unique request policy name, required",
      "type": "string"
    },
    "description": {
      "description": "Description of request policy",
      "type": "string"
    },
    "requestTypes": {
      "description": "Whether the item should be held upon return, recalled or paged for",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-type.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description" : "Description of request policy",
  "requestTypes" : ["Hold", "Page"]
}

Response 204

Request policy successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update request-policy -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"request-policy not found"

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Response 501

Not implemented yet

DELETE /request-policy-storage/request-policies/{requestPolicyId}

Delete request-policy item with given {request-policyId}

DELETE /request-policy-storage/request-policies/{requestPolicyId}
URI Parameters
  • requestPolicyId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Request policy successfully deleted

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete request-policy -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"request-policy not found"

Response 500

General errors

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator