Data export API documentation version v1.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/fileDefinitions
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",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"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"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$ref": "../../ramls/raml-util/schemas/metadata.schema"
}
},
"required": [
"fileName"
]
}
Example:
{
"id":"88dfac11-1caf-4470-9ad1-d533f6360bdd",
"fileName":"marc.mrc",
"status":"COMPLETED",
"size" : 200,
"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",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"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"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$ref": "../../ramls/raml-util/schemas/metadata.schema"
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad requestHTTP 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",
"$ref": "error.schema"
}
},
"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 errorMethod to get file definition by id
get /data-export/fileDefinitions/{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",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"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"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$ref": "../../ramls/raml-util/schemas/metadata.schema"
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad requestHTTP status code 404
Not found
Body
Media type: text/plain
Type: any
Example:
Not foundHTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Internal server errorMethod to upload file
post /data-export/fileDefinitions/{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",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"fileName": {
"description": "File name",
"type": "string"
},
"jobExecutionId": {
"description": "Job execution id",
"type": "string",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"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"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$ref": "../../ramls/raml-util/schemas/metadata.schema"
}
},
"required": [
"fileName"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad requestHTTP status code 404
Not found
Body
Media type: text/plain
Type: any
Example:
Not foundHTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Internal server error