Data export API documentation version v1.0
https://github.com/folio-org/mod-data-export
Data export API
API for exporting MARC records
/data-export
Method to start export for MARC records
Starts the export process
post /data-export/export
Starts the export process
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Necessary data to start export process",
"type": "object",
"additionalProperties": false,
"properties": {
"fileDefinition": {
"description": "File definition",
"type": "object",
"$ref": "fileDefinition.json"
},
"jobProfile": {
"description": "Related Job profile",
"type": "object",
"$ref": "jobProfile.json"
},
"metadata": {
"description": "Meta information ",
"type": "object",
"$ref": "../../ramls/raml-util/schemas/metadata.schema"
}
},
"required": [
"fileDefinition",
"jobProfile"
]
}
Example:
{
"fileDefinition": {
"id": "ecad5316-5f97-446a-bb54-68f16f71e989",
"fileName": "snapshot-test.csv",
"jobExecutionId": "6208f4de-eb2c-4a06-a880-32245fd3bce1",
"sourcePath": "./storage/files/ecad5316-5f97-446a-bb54-68f16f71e989/snapshot-test.csv",
"status": "COMPLETED"
},
"jobProfile": {
"id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
"destination": "fileSystem",
"name": "export job profile"
},
"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 204
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 errorAPI for getting JobExecutions by query
Retrieve jobExecution item with given {jobExecutionId}
get /data-export/jobExecutions
Retrieve jobExecution item with given {jobExecutionId}
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
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode status=SUCCESS - 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]
HTTP status code 200
Returns item with a given ID
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Collection of execution jobs",
"type": "object",
"additionalProperties": false,
"properties": {
"jobExecutions": {
"description": "List of execution jobs",
"type": "array",
"id": "jobExecutionList",
"items": {
"type": "object",
"$ref": "jobExecution.json"
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"jobExecutions",
"totalRecords"
]
}
Example:
{
"jobExecutions": [
{
"id": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
"hrId": "199",
"exportedFiles": [
{
"fileId": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
"fileName": "catrepbarcodes-20200116114002.mrc"
},
{
"fileId": "295e28b4-aea2-4458-9073-385a31e1da05",
"fileName": "fullexportbibonly-20200116103001.mrc"
},
{
"fileId": "bb689511-5365-4050-8084-a03d94728d88",
"fileName": "umadm-n-20200116100503.mrc"
}
],
"jobProfileInfo": {
"id": "88dfac11-1caf-4470-9ad1-d533f6360bad",
"destination": "fileSystem",
"name": "default"
},
"progress": {
"current": 1200,
"total": 109485
},
"completedDate": "2019-10-30T12:40:01.000+0000",
"startedDate": "2019-10-30T12:37:02.000+0000",
"runBy": {
"firstName": "Jane",
"lastName": "Doe"
},
"status": "SUCCESS",
"metadata": {
"createdDate": "2019-07-22T11:22:07.000+0000",
"createdByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b",
"createdByUsername": "janedoeuser",
"updatedDate": "2019-07-27T13:28:54.000+0000",
"updatedByUserId": "",
"updatedByUsername": ""
}
}
],
"totalRecords": 1
}
HTTP status code 400
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Body
Media type: text/plain
Type: any
Example:
"unable to list jobExecutions -- malformed parameter 'query', syntax error at column 6"
HTTP status code 401
Not authorized to perform requested action
Body
Media type: text/plain
Type: any
Example:
"unable to list jobExecutions -- unauthorized"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"jobExecution not found"
HTTP status code 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": {
"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, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administratorAPI for getting the link to download files
get /data-export/jobExecutions/{jobExecutionId}/download/{exportFileId}
URI Parameters
- jobExecutionId: required(string)
- exportFileId: required(string)
HTTP status code 200
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "File that should be exported",
"type": "object",
"properties": {
"fileId": {
"description": "File unique identifier",
"$ref": "../../ramls/raml-util/schemas/uuid.schema"
},
"link": {
"description": "Download link to the file",
"type": "string"
}
},
"required": [
"fileId",
"link"
]
}
Example:
{
"fileId":"448ae575-daec-49c1-8041-d64c8ed8e5b1",
"link":"https://test-aws-export-vk.s3.amazonaws.com/CatShip.mrc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20200220T185104Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=AKUAIZOH6UABI4QDF678%2F20200220%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=2d87fd96cd1b05ee74228ee9124bc0ad34196a08b03c62453e9588aa3e485a77"
}HTTP status code 400
Bad request, e.g. malformed request body or query parameter
Body
Media type: text/plain
Type: any
Example:
Bad requestHTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact Administrator