Inventory Storage Instance Batch Sync API (v0.3)

http://localhost

Table of contents

Inventory Storage Instance Batch Sync API

Batch API for synchronously uploading instances into the inventory

Instances Batch Upload Sync API

POST /instance-storage/batch/synchronous

Create or update a collection of instances in a single synchronous request

POST /instance-storage/batch/synchronous
Query Parameters
  • upsert: (boolean - default: false)

    When a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch.

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of instance records",
  "type": "object",
  "properties": {
    "instances": {
      "description": "List of instance records",
      "id": "instances",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instance.json"
      }
    }
  },
  "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"
    }
  ]
}

Response 201

All instances have been successfully created or updated

Response 413

Payload Too Large

Body

Media type: text/plain

Type: any

Example:

Payload Too Large

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

Body

Media type: text/plain

Type: any

Example:

Internal server error