Preceding/succeeding Titles API (v0.1)

http://localhost

Table of contents

Preceding/succeeding Titles API

Storage for preceding/succeeding titles in the inventory

Preceding/Succeeding titles

Collection of preceding-succeeding-title items.

GET /preceding-succeeding-titles

Return a list of preceding succeeding titles

GET /preceding-succeeding-titles
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.

    by preceding instance ID or by succeeding instance ID (using CQL))

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    precedingInstanceId==83a50dc6-b887-43d9-93ee-28b2c4cd11f8 succeedingInstanceId==30fcc8e7-a019-43f4-b642-2edc389f4501
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

The new preceding/succeeding title has been successfully returned

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of InstanceRelationship records",
  "type": "object",
  "properties": {
    "precedingSucceedingTitles": {
      "description": "List of instance relationships",
      "id": "precedingSucceedingTitles",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instanceprecedingsucceedingtitle.json"
      }
    },
    "totalRecords": {
      "type": "integer",
      "description": "Total number of records"
    }
  },
  "required": [
    "precedingSucceedingTitles",
    "totalRecords"
  ]
}

Example:

{
  "precedingSucceedingTitles": [
    {
      "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
      "precedingInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
      "succeedingInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
      "title": "A semantic web primer",
      "hrid": "inst000000000022",
      "identifiers": [
        {
          "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422",
          "value": "0262012103"
        }
      ]
    }
  ],
  "totalRecords": 1
}

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 preceding-succeeding-titles -- 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 preceding-succeeding-titles -- unauthorized

Response 422

Unprocessable Entity

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /preceding-succeeding-titles

Create a new preceding/succeeding title

POST /preceding-succeeding-titles
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#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique ID of the preceding-succeeding title",
      "type": "string",
      "$ref": "uuid.json"
    },
    "precedingInstanceId": {
      "description": "ID (a UUID) of the preceding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "succeedingInstanceId": {
      "description": "ID (a UUID) of the succeeding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "precedingInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "succeedingInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "title": "A semantic web primer",
  "hrid": "inst000000000022",
  "identifiers": [
    {
      "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "value": "0262012103"
    }
  ]
}

Response 201

The new preceding/succeeding title has been successfully created

Headers
  • Location: required (string)

    URI to the created preceding-succeeding-title item

Body

Media type: application/json

Type: any

Example:

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "precedingInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "succeedingInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "title": "A semantic web primer",
  "hrid": "inst000000000022",
  "identifiers": [
    {
      "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "value": "0262012103"
    }
  ]
}

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 preceding-succeeding-title -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create preceding-succeeding-titles -- unauthorized

Response 422

Unprocessable Entity

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /preceding-succeeding-titles/{precedingSucceedingTitleId}

Get a preceding/succeeding title by id

GET /preceding-succeeding-titles/{precedingSucceedingTitleId}
URI Parameters
  • precedingSucceedingTitleId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

The preceding/succeeding title has been returned

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique ID of the preceding-succeeding title",
      "type": "string",
      "$ref": "uuid.json"
    },
    "precedingInstanceId": {
      "description": "ID (a UUID) of the preceding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "succeedingInstanceId": {
      "description": "ID (a UUID) of the succeeding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "precedingInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "succeedingInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "title": "A semantic web primer",
  "hrid": "inst000000000022",
  "identifiers": [
    {
      "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "value": "0262012103"
    }
  ]
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"preceding-succeeding-title not found"

Response 422

Unprocessable Entity

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /preceding-succeeding-titles/{precedingSucceedingTitleId}

Update a preceding/succeeding title by id

PUT /preceding-succeeding-titles/{precedingSucceedingTitleId}
URI Parameters
  • precedingSucceedingTitleId: 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#",
  "description": "A relationship of a given type between a super-instance and a sub-instance",
  "type": "object",
  "properties": {
    "id": {
      "description": "unique ID of the preceding-succeeding title",
      "type": "string",
      "$ref": "uuid.json"
    },
    "precedingInstanceId": {
      "description": "ID (a UUID) of the preceding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "succeedingInstanceId": {
      "description": "ID (a UUID) of the succeeding instance",
      "type": "string",
      "$ref": "uuid.json"
    },
    "title": {
      "type": "string",
      "description": "The primary title (or label) associated with the resource"
    },
    "hrid": {
      "type": "string",
      "description": "The human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID"
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "UUID of resource identifier type (e.g. ISBN, ISSN, LCCN, CODEN, Locally defined identifiers)",
            "$ref": "uuid.json"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}

Example:

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "precedingInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "succeedingInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "title": "A semantic web primer",
  "hrid": "inst000000000022",
  "identifiers": [
    {
      "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422",
      "value": "0262012103"
    }
  ]
}

Response 204

The preceding/succeeding title has been 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 preceding-succeeding-title -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"preceding-succeeding-title not found"

Response 422

Unprocessable Entity

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

DELETE /preceding-succeeding-titles/{precedingSucceedingTitleId}

Delete a preceding/succeeding title by id

DELETE /preceding-succeeding-titles/{precedingSucceedingTitleId}
URI Parameters
  • precedingSucceedingTitleId: required (string)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

The preceding/succeeding title has been deleted

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

"unable to delete preceding-succeeding-title -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"preceding-succeeding-title not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator