Instance Storage v4.6 Documentation

Instance Storage API

Storage for instances in the inventory

Endpoints

http://localhost

/instance-storage

/instance-storage/instance-relationships

Description

Collection of instance-relationship items.

get

Description

Retrieve a list of instance-relationship items.

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

query string

A query expressed as a CQL string (see dev.folio.org/doc/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 parent ID or by child ID (using CQL)

Example: (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode subInstanceId==83a50dc6-b887-43d9-93ee-28b2c4cd11f8superInstanceId==30fcc8e7-a019-43f4-b642-2edc389f4501instanceRelationshipTypeId==758f13db-ffb4-440e-bb10-8a364aa6cb4a AND superInstanceId=30fcc8e7-a019-43f4-b642-2edc389f4501
offset integer
Maximum: 2147483647

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

limit integer
Default: 10 Maximum: 2147483647

Limit the number of elements returned in the response

Example: 10
lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

200 OK

Returns a list of instance-relationship items

Response Example (application/json)
{
  "instanceRelationships": [
    {
     "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
     "superInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
     "subInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
     "instanceRelationshipTypeId": "758f13db-ffb4-440e-bb10-8a364aa6cb4a"
    },
    {
     "id": "b87c7c37-b8a4-432f-9d76-f9d215602776",
     "superInstanceId": "60e89ae2-9c93-4819-bbbe-dd8e0ec78177",
     "subInstanceId": "6a3aa70f-0204-41a0-ab58-06a42cb5032c",
     "instanceRelationshipTypeId": "30773a27-b485-4dab-aeb6-b8c04fa3cb17"
    }
  ],
  "totalRecords": 2
}

400 Bad Request

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.

Response Example (text/plain)
unable to list instance-relationships -- malformed parameter 'query', syntax error at column 6

401 Unauthorized

Not authorized to perform requested action

Response Example (text/plain)
unable to list instance-relationships -- unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

post

Description

Create a new instance-relationship item.

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "type": "string"
    },
    "subInstanceId": {
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}

Request Example (application/json)

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "superInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "subInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "instanceRelationshipTypeId": "758f13db-ffb4-440e-bb10-8a364aa6cb4a"
}

Responses

201 Created

Returns a newly created item, with server-controlled fields like 'id' populated

Response Headers

Location string

URI to the created instance-relationship item

Response Example (application/json)
{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "superInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "subInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "instanceRelationshipTypeId": "758f13db-ffb4-440e-bb10-8a364aa6cb4a"
}

400 Bad Request

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.

Response Example (text/plain)
"unable to add instance-relationship -- malformed JSON at 13:3"

401 Unauthorized

Not authorized to perform requested action

Response Example (text/plain)
unable to create instance-relationships -- unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

/instance-storage/instance-relationships/{relationshipId}

Description

Entity representing a instance-relationship

URI Parameters

relationshipId string required

get

Description

Get Instance Relationship

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

200 OK

Returns item with a given ID

Response Example (application/json)
{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "superInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "subInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "instanceRelationshipTypeId": "758f13db-ffb4-440e-bb10-8a364aa6cb4a"
}

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance-relationship not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

delete

Description

Delete instance-relationship item with given {instance-relationshipId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

204 No Content

Item deleted successfully

400 Bad Request

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.

Response Example (text/plain)
"unable to delete instance-relationship -- constraint violation"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance-relationship not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

put

Description

Update instance-relationship item with given {instance-relationshipId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "superInstanceId": {
      "type": "string"
    },
    "subInstanceId": {
      "type": "string"
    },
    "instanceRelationshipTypeId": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "superInstanceId",
    "subInstanceId",
    "instanceRelationshipTypeId"
  ]
}

Request Example (application/json)

{
  "id": "4b8093b8-8de9-41be-ad9a-0fbccb99052b",
  "superInstanceId": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "subInstanceId": "83a50dc6-b887-43d9-93ee-28b2c4cd11f8",
  "instanceRelationshipTypeId": "758f13db-ffb4-440e-bb10-8a364aa6cb4a"
}

Responses

204 No Content

Item successfully updated

400 Bad Request

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.

Response Example (text/plain)
"unable to update instance-relationship -- malformed JSON at 13:4"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance-relationship not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

/instance-storage/instances

Description

Collection of instance items.

get

Description

Retrieve a list of instance items.

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

query string

A query expressed as a CQL string (see dev.folio.org/doc/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 title (using CQL)

Example: (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode title="*uproot*"
offset integer
Maximum: 2147483647

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

limit integer
Default: 10 Maximum: 2147483647

Limit the number of elements returned in the response

Example: 10
lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

200 OK

Returns a list of instance items

Response Example (application/json)
{
  "instances": [
    {
      "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
      "title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
      "source": "Local: MARC",
      "contributors": [
        {
          "name": "Sigal, Ari",
          "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
          "primary": true
        }
      ],
      "identifiers": [
        {
          "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
          "value": "9781466636897"
        },
        {
          "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
          "value": "1"
        }
      ],
      "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
    },
    {
      "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
      "title": "ADVANCING RESEARCH METHODS WITH NEW TECHNOLOGIES.",
      "source": "Local: MARC",
      "contributors": [
        {
          "name": "Sappleton, Natalie",
          "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
          "primary": true
        }
      ],
      "identifiers": [
        {
          "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
          "value": "9781466639195"
        },
        {
          "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
          "value": "2"
        }
      ],
      "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
    }
  ],
  "totalRecords": 2
}

400 Bad Request

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.

Response Example (text/plain)
unable to list instances -- malformed parameter 'query', syntax error at column 6

401 Unauthorized

Not authorized to perform requested action

Response Example (text/plain)
unable to list instances -- unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

post

Description

Create a new instance item.

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "hrid": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "indexTitle": {
      "type": "string"
    },
    "alternativeTitles": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "edition": {
      "type": "string"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "identifiers": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "identifierTypeId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "contributors": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "contributorTypeId": {
            "type": "string"
          },
          "contributorTypeText": {
            "type": "string"
          },
          "contributorNameTypeId": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "contributorNameTypeId"
        ]
      }
    },
    "subjects": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "classifications": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "classificationNumber": {
            "type": "string"
          },
          "classificationTypeId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "classificationNumber",
          "classificationTypeId"
        ]
      }
    },
    "publication": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string"
          },
          "place": {
            "type": "string"
          },
          "dateOfPublication": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      }
    },
    "publicationFrequency": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationRange": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "urls": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "electronicAccess": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "linkText": {
            "type": "string"
          },
          "materialsSpecification": {
            "type": "string"
          },
          "publicNote": {
            "type": "string"
          },
          "relationship": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "uri"
        ]
      }
    },
    "instanceTypeId": {
      "type": "string"
    },
    "instanceFormatId": {
      "type": "string"
    },
    "physicalDescriptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "modeOfIssuanceId": {
      "type": "string"
    },
    "catalogingLevelId": {
      "type": "string"
    },
    "catalogedDate": {
      "type": "string"
    },
    "previouslyHeld": {
      "type": "boolean"
    },
    "staffSuppress": {
      "type": "boolean"
    },
    "discoverySuppress": {
      "type": "boolean"
    },
    "statisticalCodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "statisticalCodeTypeId": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    },
    "sourceRecordFormat": {
      "description": "Format of the instance source record, if a source record exists",
      "type": "string",
      "enum": ["MARC-JSON"],
      "readonly": true
    },
    "statusId": {
      "type": "string"
    },
    "statusUpdatedDate": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "source",
    "title",
    "instanceTypeId"
  ]
}

Request Example (application/json)

{
  "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "source": "Local: MARC",
  "title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
  "contributors": [
    {
      "name": "Sigal, Ari",
      "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
      "primary": true
    }
  ],
  "identifiers": [
    {
      "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
      "value": "9781466636897"
    },
    {
      "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
      "value": "1"
    }
  ],
  "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
}

Responses

201 Created

Returns a newly created item, with server-controlled fields like 'id' populated

Response Headers

Location string

URI to the created instance item

Response Example (application/json)
{
  "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "source": "Local: MARC",
  "title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
  "contributors": [
    {
      "name": "Sigal, Ari",
      "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
      "primary": true
    }
  ],
  "identifiers": [
    {
      "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
      "value": "9781466636897"
    },
    {
      "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
      "value": "1"
    }
  ],
  "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
}

400 Bad Request

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.

Response Example (text/plain)
"unable to add instance -- malformed JSON at 13:3"

401 Unauthorized

Not authorized to perform requested action

Response Example (text/plain)
unable to create instances -- unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

delete

Responses

204 No Content

All instances deleted

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

/instance-storage/instances/{instanceId}

Description

Entity representing a instance

URI Parameters

instanceId string required

get

Description

Get Instance by InstanceId Instances are stored and accessed by a hash of key properties. The rules which govern how instance hashes are computed are business rules and defined in the service layer. the storage layer only knows how to insert or retrieve instance records by ID.

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

200 OK

Returns item with a given ID

Response Example (application/json)
{
  "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "source": "Local: MARC",
  "title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
  "contributors": [
    {
      "name": "Sigal, Ari",
      "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
      "primary": true
    }
  ],
  "identifiers": [
    {
      "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
      "value": "9781466636897"
    },
    {
      "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
      "value": "1"
    }
  ],
  "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
}

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

delete

Description

Delete instance item with given {instanceId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

204 No Content

Item deleted successfully

400 Bad Request

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.

Response Example (text/plain)
"unable to delete instance -- constraint violation"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

put

Description

Update instance item with given {instanceId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "hrid": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "indexTitle": {
      "type": "string"
    },
    "alternativeTitles": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "edition": {
      "type": "string"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "identifiers": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "identifierTypeId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "contributors": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "contributorTypeId": {
            "type": "string"
          },
          "contributorTypeText": {
            "type": "string"
          },
          "contributorNameTypeId": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "required": [
          "name",
          "contributorNameTypeId"
        ]
      }
    },
    "subjects": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "classifications": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "classificationNumber": {
            "type": "string"
          },
          "classificationTypeId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "classificationNumber",
          "classificationTypeId"
        ]
      }
    },
    "publication": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "publisher": {
            "type": "string"
          },
          "place": {
            "type": "string"
          },
          "dateOfPublication": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      }
    },
    "publicationFrequency": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "publicationRange": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "urls": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "electronicAccess": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "linkText": {
            "type": "string"
          },
          "materialsSpecification": {
            "type": "string"
          },
          "publicNote": {
            "type": "string"
          },
          "relationship": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": [
          "uri"
        ]
      }
    },
    "instanceTypeId": {
      "type": "string"
    },
    "instanceFormatId": {
      "type": "string"
    },
    "physicalDescriptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "languages": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "modeOfIssuanceId": {
      "type": "string"
    },
    "catalogingLevelId": {
      "type": "string"
    },
    "catalogedDate": {
      "type": "string"
    },
    "previouslyHeld": {
      "type": "boolean"
    },
    "staffSuppress": {
      "type": "boolean"
    },
    "discoverySuppress": {
      "type": "boolean"
    },
    "statisticalCodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "statisticalCodeTypeId": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    },
    "sourceRecordFormat": {
      "description": "Format of the instance source record, if a source record exists",
      "type": "string",
      "enum": ["MARC-JSON"],
      "readonly": true
    },
    "statusId": {
      "type": "string"
    },
    "statusUpdatedDate": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "source",
    "title",
    "instanceTypeId"
  ]
}

Request Example (application/json)

{
  "id": "601a8dc4-dee7-48eb-b03f-d02fdf0debd0",
  "source": "Local: MARC",
  "title": "ADVANCING LIBRARY EDUCATION: TECHNOLOGICAL INNOVATION AND INSTRUCTIONAL DESIGN",
  "contributors": [
    {
      "name": "Sigal, Ari",
      "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a",
      "primary": true
    }
  ],
  "identifiers": [
    {
      "identifierTypeId": "2e48e713-17f3-4c13-a9f8-23845bb210af",
      "value": "9781466636897"
    },
    {
      "identifierTypeId": "6051f95c-028e-4c6a-8a9e-ee689dd51453",
      "value": "1"
    }
  ],
  "instanceTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2c"
}

Responses

204 No Content

Item successfully updated

400 Bad Request

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.

Response Example (text/plain)
"unable to update instance -- malformed JSON at 13:4"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"instance not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

/instance-storage/instances/{instanceId}/source-record

delete

Description

Delete the source record. Note: The source records gets automatically deleted when its instance record is deleted.

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

204 No Content

Source record deleted

404 Not Found

There is no source record for that instanceId

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

/instance-storage/instances/{instanceId}/source-record/marc-json

Description

Entity representing a marc-json

get

Description

Retrieve marc-json item with given {marc-jsonId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

200 OK

Returns item with a given ID

Response Example (application/json)
{
  "leader":"00452nam a2200169 ca4500",
  "fields":[
    {"001":"029857716"},
    {"003":"DE-601"},
    {"005":"20180511131518.0"},
    {"008":"900626m19799999xxk\\\\\\\\\\\\\\\\\\\\\\000\\0\\eng\\d"},
    {"035":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"a":"(DE-599)GBV029857716"}]}},
    {"040":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"b":"ger"},
                         {"c":"GBVCP"}]}},
    {"041":{"ind1":"0",
            "ind2":"\\",
            "subfields":[{"a":"eng"}]}},
    {"044":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"a":"xxk"},
                         {"a":"at"}]}},
    {"100":{"ind1":"1",
            "ind2":"\\",
            "subfields":[{"a":"Adams, Douglas"}]}},
    {"245":{"ind1":"1",
            "ind2":"4",
            "subfields":[{"a":"The Hitch Hiker's guide to the Galaxy"},
                         {"c":"Douglas Adams"}]}},
    {"246":{"ind1":"1",
            "ind2":"3",
            "subfields":[{"i":"Nebent."},
                         {"a":"The hitchhiker series"}]}},
    {"264":{"ind1":"3",
            "ind2":"1",
            "subfields":[{"a":"London [u.a.]"},
                         {"b":"Pan Books"},
                         {"c":"1979-"}]}}
  ]
}

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"marc-json not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

delete

Description

Delete marc-json item with given {marc-jsonId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

204 No Content

Item deleted successfully

400 Bad Request

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.

Response Example (text/plain)
"unable to delete marc-json -- constraint violation"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"marc-json not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
Internal server error, contact administrator

put

Description

Update marc-json item with given {marc-jsonId}

Request Headers

Authorization string required

Used to send a valid JWT token.

Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Request JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "MARC record representation, compatible with MarcEdit's JSON export and import",
  "type": "object",
  "properties": {
    "leader": {
      "type": "string",
      "minLength": 24,
      "maxLength": 24
    },
    "fields": {
      "type": "array",
      "minItems": 2
    }
  },
  "additionalProperties": false,
  "required": [
    "leader",
    "fields"
  ]
}

Request Example (application/json)

{
  "leader":"00452nam a2200169 ca4500",
  "fields":[
    {"001":"029857716"},
    {"003":"DE-601"},
    {"005":"20180511131518.0"},
    {"008":"900626m19799999xxk\\\\\\\\\\\\\\\\\\\\\\000\\0\\eng\\d"},
    {"035":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"a":"(DE-599)GBV029857716"}]}},
    {"040":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"b":"ger"},
                         {"c":"GBVCP"}]}},
    {"041":{"ind1":"0",
            "ind2":"\\",
            "subfields":[{"a":"eng"}]}},
    {"044":{"ind1":"\\",
            "ind2":"\\",
            "subfields":[{"a":"xxk"},
                         {"a":"at"}]}},
    {"100":{"ind1":"1",
            "ind2":"\\",
            "subfields":[{"a":"Adams, Douglas"}]}},
    {"245":{"ind1":"1",
            "ind2":"4",
            "subfields":[{"a":"The Hitch Hiker's guide to the Galaxy"},
                         {"c":"Douglas Adams"}]}},
    {"246":{"ind1":"1",
            "ind2":"3",
            "subfields":[{"i":"Nebent."},
                         {"a":"The hitchhiker series"}]}},
    {"264":{"ind1":"3",
            "ind2":"1",
            "subfields":[{"a":"London [u.a.]"},
                         {"b":"Pan Books"},
                         {"c":"1979-"}]}}
  ]
}

Responses

204 No Content

Item successfully updated

400 Bad Request

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.

Response Example (text/plain)
"unable to update marc-json -- malformed JSON at 13:4"

401 Unauthorized

No valid token found

Response Example (text/plain)
Unauthorized

403 Forbidden

Access denied, not valid privilege in resources

Response Example (text/plain)
Unauthorized

404 Not Found

Item with a given ID not found

Response Example (text/plain)
"marc-json not found"

500 Internal Server Error

Internal server error, e.g. due to misconfiguration

Response Example (text/plain)
internal server error, contact administrator

/instance-storage/instances/{instanceId}/source-record/mods

get

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

500 Internal Server Error

Not implemented yet

Response Example (text/plain)
Not implemented yet

put

Query Parameters

lang string
Default: en Pattern: [a-zA-Z]{2}

Requested language. Optional. [lang=en]

Responses

500 Internal Server Error

Not implemented yet

Response Example (text/plain)
Not implemented yet