http://localhost
Batch API for synchronously uploading instances into the inventory
Create or update a collection of instances in a single synchronous request; if any instance fails the complete batch will be rejected (all or nothing)
POST /instance-storage/batch/synchronousWhen a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch. The _version property of each instance to be updated must match the stored _version property (optimistic locking).
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of instance records",
"javaType": "org.folio.rest.jaxrs.model.InstancesPostRequest",
"type": "object",
"properties": {
"instances": {
"description": "List of instance records",
"id": "instances",
"type": "array",
"items": {
"$ref": "instance.json",
"type" : "object"
}
}
},
"additionalProperties": false,
"required": [
"instances"
]
}
Example:
{
"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",
"tags" : {
"tagList" : [
"important"
]
}
},
{
"id": "f31a36de-fcf8-44f9-87ef-a55d06ad21ae",
"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"
}
]
}
All instances have been successfully created or updated
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version errorPayload Too Large
Media type: text/plain
Type: any
Example:
Payload Too LargeUnprocessable Entity
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"
}
}
}Internal server error
Media type: text/plain
Type: any
Example:
Internal server error