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
  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    none
  • 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. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    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"
    

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "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",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "Whether the item should be held upon return, recalled or paged for",
              "enum": [
                "Hold",
                "Recall",
                "Page"
              ],
              "additionalProperties": false
            }
          },
          "allowedServicePoints": {
            "description": "Allowed pickup service point IDs by request type",
            "type": "object",
            "properties": {
              "Page": {
                "description": "Allowed pickup service point IDs for Page requests",
                "type": "array",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "default": null,
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                  "description": "UUID string",
                  "type": "string",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "id": "uuid.schema",
                  "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
                }
              },
              "Hold": {
                "description": "Allowed pickup service point IDs for Hold requests",
                "type": "array",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "default": null,
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                  "description": "UUID string",
                  "type": "string",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "id": "uuid.schema",
                  "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
                }
              },
              "Recall": {
                "description": "Allowed pickup service point IDs for Recall requests",
                "type": "array",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "default": null,
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                  "description": "UUID string",
                  "type": "string",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "id": "uuid.schema",
                  "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
                }
              }
            },
            "additionalProperties": false
          },
          "metadata": {
            "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "type": "object",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "name"
        ]
      }
    },
    "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
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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Whether the item should be held upon return, recalled or paged for",
        "enum": [
          "Hold",
          "Recall",
          "Page"
        ],
        "additionalProperties": false
      }
    },
    "allowedServicePoints": {
      "description": "Allowed pickup service point IDs by request type",
      "type": "object",
      "properties": {
        "Page": {
          "description": "Allowed pickup service point IDs for Page requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Hold": {
          "description": "Allowed pickup service point IDs for Hold requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Recall": {
          "description": "Allowed pickup service point IDs for Recall requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        }
      },
      "additionalProperties": false
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description": "Description of request policy",
  "requestTypes": ["Hold", "Page"],
  "allowedServicePoints": {
    "Page": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f"
    ],
    "Hold": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f",
      "33253ea7-74ce-49ef-8288-67aa3bda2b41"
    ]
  }
}

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Whether the item should be held upon return, recalled or paged for",
        "enum": [
          "Hold",
          "Recall",
          "Page"
        ],
        "additionalProperties": false
      }
    },
    "allowedServicePoints": {
      "description": "Allowed pickup service point IDs by request type",
      "type": "object",
      "properties": {
        "Page": {
          "description": "Allowed pickup service point IDs for Page requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Hold": {
          "description": "Allowed pickup service point IDs for Hold requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Recall": {
          "description": "Allowed pickup service point IDs for Recall requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        }
      },
      "additionalProperties": false
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description": "Description of request policy",
  "requestTypes": ["Hold", "Page"],
  "allowedServicePoints": {
    "Page": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f"
    ],
    "Hold": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f",
      "33253ea7-74ce-49ef-8288-67aa3bda2b41"
    ]
  }
}

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 422

Request policy validation failure

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"
    }
  }
}

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

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)

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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Whether the item should be held upon return, recalled or paged for",
        "enum": [
          "Hold",
          "Recall",
          "Page"
        ],
        "additionalProperties": false
      }
    },
    "allowedServicePoints": {
      "description": "Allowed pickup service point IDs by request type",
      "type": "object",
      "properties": {
        "Page": {
          "description": "Allowed pickup service point IDs for Page requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Hold": {
          "description": "Allowed pickup service point IDs for Hold requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Recall": {
          "description": "Allowed pickup service point IDs for Recall requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        }
      },
      "additionalProperties": false
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description": "Description of request policy",
  "requestTypes": ["Hold", "Page"],
  "allowedServicePoints": {
    "Page": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f"
    ],
    "Hold": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f",
      "33253ea7-74ce-49ef-8288-67aa3bda2b41"
    ]
  }
}

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)
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",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Whether the item should be held upon return, recalled or paged for",
        "enum": [
          "Hold",
          "Recall",
          "Page"
        ],
        "additionalProperties": false
      }
    },
    "allowedServicePoints": {
      "description": "Allowed pickup service point IDs by request type",
      "type": "object",
      "properties": {
        "Page": {
          "description": "Allowed pickup service point IDs for Page requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Hold": {
          "description": "Allowed pickup service point IDs for Hold requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        },
        "Recall": {
          "description": "Allowed pickup service point IDs for Recall requests",
          "type": "array",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "default": null,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "description": "UUID string",
            "type": "string",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          }
        }
      },
      "additionalProperties": false
    },
    "metadata": {
      "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "type": "object",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}

Example:

{
  "id": "d9cd0bed-1b49-4b5e-a7bd-064b8d177231",
  "name": "Example Request Policy",
  "description": "Description of request policy",
  "requestTypes": ["Hold", "Page"],
  "allowedServicePoints": {
    "Page": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f"
    ],
    "Hold": [
      "13934820-81ca-47ed-ac88-6f3e3bab106f",
      "33253ea7-74ce-49ef-8288-67aa3bda2b41"
    ]
  }
}

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 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

Response 422

Request policy validation failure

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"
    }
  }
}

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)

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