Data export version v3.0
https://github.com/folio-org/mod-data-export
Data export File Definition API
APIs for creating fileDefinition to upload files
File upload service
Service provides APIs supporting file upload
API to create file definition to use it for the file uploading
post /data-export/file-definitions
API to create file definition to use it for the file uploading
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "File definition",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID of this File Definition",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"sourcePath": {
"description": "Path to the file",
"type": "string"
},
"status": {
"description": "Status of file upload",
"type": "string",
"enum": [
"NEW",
"IN_PROGRESS",
"COMPLETED",
"ERROR"
]
},
"size": {
"description": "Size of the file in Kbyte",
"type": "integer"
},
"uploadFormat": {
"description": "Format of upload file",
"type": "string",
"enum": [
"csv",
"cql"
],
"default": "csv"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"fileName"
]
}
Example:
{
"id":"88dfac11-1caf-4470-9ad1-d533f6360bdd",
"fileName":"marc.csv",
"status":"COMPLETED",
"size" : 200,
"uploadFormat": "csv",
"metadata":
{
"createdDate": "2019-07-22T11:22:07Z",
"createdByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b",
"createdByUsername": "janedoeuser",
"updatedDate": "2019-07-27T13:28:54Z",
"updatedByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b",
"updatedByUsername": ""
}
}
HTTP status code 201
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "File definition",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID of this File Definition",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"sourcePath": {
"description": "Path to the file",
"type": "string"
},
"status": {
"description": "Status of file upload",
"type": "string",
"enum": [
"NEW",
"IN_PROGRESS",
"COMPLETED",
"ERROR"
]
},
"size": {
"description": "Size of the file in Kbyte",
"type": "integer"
},
"uploadFormat": {
"description": "Format of upload file",
"type": "string",
"enum": [
"csv",
"cql"
],
"default": "csv"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad request
HTTP status code 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",
"$schema": "http://json-schema.org/draft-04/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": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"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"
}
]
}
]
}
HTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Internal server error
Method to get file definition by id
get /data-export/file-definitions/{fileDefinitionId}
Method to get file definition by id
URI Parameters
- fileDefinitionId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "File definition",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID of this File Definition",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"sourcePath": {
"description": "Path to the file",
"type": "string"
},
"status": {
"description": "Status of file upload",
"type": "string",
"enum": [
"NEW",
"IN_PROGRESS",
"COMPLETED",
"ERROR"
]
},
"size": {
"description": "Size of the file in Kbyte",
"type": "integer"
},
"uploadFormat": {
"description": "Format of upload file",
"type": "string",
"enum": [
"csv",
"cql"
],
"default": "csv"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad request
HTTP status code 404
Not found
Body
Media type: text/plain
Type: any
Example:
Not found
HTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Internal server error
Method to upload file
post /data-export/file-definitions/{fileDefinitionId}/upload
Method to upload file
URI Parameters
- fileDefinitionId: required(string)
Body
Media type: application/octet-stream
Type: any
HTTP status code 200
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "File definition",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID of this File Definition",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"sourcePath": {
"description": "Path to the file",
"type": "string"
},
"status": {
"description": "Status of file upload",
"type": "string",
"enum": [
"NEW",
"IN_PROGRESS",
"COMPLETED",
"ERROR"
]
},
"size": {
"description": "Size of the file in Kbyte",
"type": "integer"
},
"uploadFormat": {
"description": "Format of upload file",
"type": "string",
"enum": [
"csv",
"cql"
],
"default": "csv"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad request
HTTP status code 404
Not found
Body
Media type: text/plain
Type: any
Example:
Not found
HTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Internal server error