Data export (v1.0)

https://github.com/folio-org/mod-data-export

Table of contents

Data export Job Profile API

APIs for creating job Profiles to manage export jobs

/data-export/jobProfiles

Service provides APIs supporting Job profiles

POST /data-export/jobProfiles

Create a new jobProfile item.

POST /data-export/jobProfiles
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#",
  "description": "Job profile",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Job Profile name",
      "type": "string"
    },
    "destination": {
      "description": "Final destination place where to send file",
      "type": "string"
    },
    "description": {
      "description": "Job Profile description",
      "type": "string"
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Job Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "mappingProfileId": {
      "description": "Associated mapping profile id",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "protocol": {
      "description": "TCP/IP settings",
      "type": "object",
      "$ref": "protocol.json"
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "mappingProfileId"
  ]
}

Example:

{
  "id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
  "name": "job profile name",
  "destination": "fileSystem",
  "description": "Job profile description",
  "userInfo": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR",
    "userName": "diku_admin"
  },
  "mappingProfileId": "3798f546-7afb-11ea-bc55-0242ac130003",
  "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": ""
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created jobProfile item

Body

Media type: application/json

Type: any

Example:

{
  "id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
  "name": "job profile name",
  "destination": "fileSystem",
  "description": "Job profile description",
  "userInfo": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR",
    "userName": "diku_admin"
  },
  "mappingProfileId": "3798f546-7afb-11ea-bc55-0242ac130003",
  "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": ""
  }
}

Response 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 add jobProfile -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create jobProfiles -- 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": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /data-export/jobProfiles

Retrieve a list of jobProfile items.

GET /data-export/jobProfiles
Query Parameters
  • 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
  • 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
    
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of jobProfile items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of Job Profiles",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "jobProfiles": {
      "description": "List of Job Profiles",
      "type": "array",
      "id": "jobProfileList",
      "items": {
        "type": "object",
        "$ref": "jobProfile.json"
      }
    },
    "totalRecords": {
      "description": "Total number of Job Profiles",
      "type": "integer"
    }
  },
  "required": [
    "jobProfiles",
    "totalRecords"
  ]
}

Example:

{
  "jobProfiles": [
    {
      "id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
      "name": "Job profile name",
      "destination": "fileSystem",
      "description": "Job profile description",
      "userInfo": {
        "firstName": "DIKU",
        "lastName": "ADMINISTRATOR",
        "userName": "diku_admin"
      },
      "mappingProfileId": "3798f546-7afb-11ea-bc55-0242ac130003",
      "metadata": {
        "createdDate": "2020-04-10T12:41:22.000",
        "createdByUserId": "",
        "createdByUsername": "@username",
        "updatedDate": "2020-04-10T12:41:22.000",
        "updatedByUserId": "",
        "updatedByUsername": "@username"
      }
    }
  ],
  "totalRecords": 1
}

Response 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 jobProfiles -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list jobProfiles -- 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": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

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

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /data-export/jobProfiles/{id}

Retrieve jobProfile item with given {jobProfileId}

GET /data-export/jobProfiles/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a job Profile

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Job profile",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Job Profile name",
      "type": "string"
    },
    "destination": {
      "description": "Final destination place where to send file",
      "type": "string"
    },
    "description": {
      "description": "Job Profile description",
      "type": "string"
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Job Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "mappingProfileId": {
      "description": "Associated mapping profile id",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "protocol": {
      "description": "TCP/IP settings",
      "type": "object",
      "$ref": "protocol.json"
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "mappingProfileId"
  ]
}

Example:

{
  "id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
  "name": "job profile name",
  "destination": "fileSystem",
  "description": "Job profile description",
  "userInfo": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR",
    "userName": "diku_admin"
  },
  "mappingProfileId": "3798f546-7afb-11ea-bc55-0242ac130003",
  "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": ""
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobProfile not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /data-export/jobProfiles/{id}

Delete jobProfile item with given {jobProfileId}

DELETE /data-export/jobProfiles/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a job Profile

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 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 delete jobProfile -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobProfile not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /data-export/jobProfiles/{id}

Update jobProfile item with given {jobProfileId}

PUT /data-export/jobProfiles/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a job Profile

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#",
  "description": "Job profile",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Job Profile name",
      "type": "string"
    },
    "destination": {
      "description": "Final destination place where to send file",
      "type": "string"
    },
    "description": {
      "description": "Job Profile description",
      "type": "string"
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Job Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "mappingProfileId": {
      "description": "Associated mapping profile id",
      "type": "string",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "protocol": {
      "description": "TCP/IP settings",
      "type": "object",
      "$ref": "protocol.json"
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "mappingProfileId"
  ]
}

Example:

{
  "id": "448ae575-daec-49c1-8041-d64c8ed8e5b1",
  "name": "job profile name",
  "destination": "fileSystem",
  "description": "Job profile description",
  "userInfo": {
    "firstName": "DIKU",
    "lastName": "ADMINISTRATOR",
    "userName": "diku_admin"
  },
  "mappingProfileId": "3798f546-7afb-11ea-bc55-0242ac130003",
  "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": ""
  }
}

Response 204

Item successfully updated

Response 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 update jobProfile -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"jobProfile not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator