Data import (v1.1)

http://localhost

Table of contents

Data import API

API for uploading source records and processing them

/data-import

POST /data-import/upload/definition

Create a new definition item.

POST /data-import/upload/definition
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#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Example:

{
  "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "metaJobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360asd",
  "status": "NEW"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created definition item

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Example:

{
  "id": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
  "metaJobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360asd",
  "status": "NEW"
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create definition -- 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": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /data-import/upload/definition

Get a list of definitions

GET /data-import/upload/definition
Query Parameters
  • 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.

    with valid searchable fields: for example id=67dfac11-1caf-4470-9ad1-d533f6360bdd

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    id=67dfac11-1caf-4470-9ad1-d533f6360bdd
    
  • 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
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of definition items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of upload definitions",
  "properties": {
    "uploadDefinitions": {
      "description": "Array of upload definitions",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "uploadDefinition.json"
      }
    },
    "totalRecords": {
      "description": "Total records in collection",
      "type": "integer"
    }
  },
  "required": [
    "uploadDefinitions",
    "totalRecords"
  ]
}

Example:

{
   "uploadDefinitions":[
      {
         "id":"17dfac11-1caf-4470-9ad1-d533f6360bdd",
         "metaJobExecutionId":"37dfac11-1caf-4470-9ad1-d533f6360asd",
         "status":"NEW"
      },
      {
         "id":"27dfac11-1caf-4470-9ad1-d533f6360bdd",
         "metaJobExecutionId":"47dfac11-1caf-4470-9ad1-d533f6360asd",
         "status":"NEW"
      }
   ],
   "totalRecords":2
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list definition -- unauthorized

Response 422

Validation errors

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": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

PUT /data-import/upload/definition/{definitionId}

Update upload definition

PUT /data-import/upload/definition/{definitionId}
URI Parameters
  • definitionId: required (string)
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

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": {
      "type": "integer"
    }
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

GET /data-import/upload/definition/{definitionId}

Get upload definition by id

GET /data-import/upload/definition/{definitionId}
URI Parameters
  • definitionId: required (string)

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /data-import/upload/definition/file

POST /data-import/upload/definition/file
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Uploaded file metadata entity",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "sourcePath": {
      "description": "The path to the file location",
      "type": "string",
      "readonly": true
    },
    "name": {
      "description": "Name of the file with extension",
      "type": "string"
    },
    "jobExecutionId": {
      "description": "Link to JobExecution entity",
      "type": "string"
    },
    "uploadDefinitionId": {
      "description": "Link to UploadDefinition entity",
      "type": "string"
    },
    "loaded": {
      "description": "Flag that indicates whether the file is loaded",
      "type": "boolean"
    },
    "createDate": {
      "description": "Date and time when the file definition was created",
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "name"
  ]
}

Response 201

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

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": {
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

DELETE /data-import/upload/definition/file/{fileId}

Delete file by id

DELETE /data-import/upload/definition/file/{fileId}
URI Parameters
  • fileId: required (string)
Query Parameters
  • uploadDefinitionId: required (string)

Response 204

Body

Media type: text/plain

Type: any

Response 404

File not found

Body

Media type: text/plain

Type: any

Example:

File not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error

POST /data-import/upload/file

Upload file

POST /data-import/upload/file
Query Parameters
  • uploadDefinitionId: required (string)
  • fileId: required (string)
Body

Media type: application/octet-stream

Type: any

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Upload process definition",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "UUID",
      "type": "string"
    },
    "metaJobExecutionId": {
      "description": "Link to the metajob execution",
      "type": "string"
    },
    "status": {
      "description": "Status of upload",
      "type": "string",
      "enum": ["NEW", "IN_PROGRESS", "LOADED", "COMPLETED"]
    },
    "createDate": {
      "description": "Date and time when the upload definition was created",
      "type": "string",
      "format": "date-time"
    },
    "fileDefinitions": {
      "description": "Array of file entities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fileDefinition.json"
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  }
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 404

Not found

Body

Media type: text/plain

Type: any

Example:

Not found

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error