Data export (v1.0)

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

Table of contents

Data export Mapping Profile API

APIs for managing Mapping Profiles

/data-export/mappingProfiles

Service provides APIs supporting Mapping profiles

POST /data-export/mappingProfiles

Create a new mappingProfile item.

POST /data-export/mappingProfiles
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": "Mapping Profile schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Mapping Profile name",
      "type": "string"
    },
    "description": {
      "description": "Mapping Profile description",
      "type": "string"
    },
    "recordTypes": {
      "description": "Mapping Profile records type",
      "type": "array",
      "items": {
        "type": "string",
        "$ref": "recordTypes.json"
      }
    },
    "transformations": {
      "description": "List of mapping profile transformations",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "transformations.json"
      }
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Mapping Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "outputFormat": {
      "description": "Mapping Profile output format",
      "type": "string",
      "enum": [
        "MARC"
      ]
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "recordTypes"
  ]
}

Example:

{
  "id": "3798f546-7afb-11ea-bc55-0242ac130003",
  "name": "Mapping profile",
  "description": "Mapping profile description",
  "recordTypes": [
    "INSTANCE"
  ],
  "outputFormat": "MARC",
  "transformations": [
    {
      "fieldId": "electronicAccess.linkText",
      "path": "Json path for electronicAccess[*].linkText",
      "transformation": "001",
      "enabled": true,
      "recordType": "INSTANCE"
    }
  ],
  "userInfo": {
    "firstName": "User",
    "lastName": "User",
    "userName": "@username"
  },
  "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 mappingProfile item

Body

Media type: application/json

Type: any

Example:

{
  "id": "3798f546-7afb-11ea-bc55-0242ac130003",
  "name": "Mapping profile",
  "description": "Mapping profile description",
  "recordTypes": [
    "INSTANCE"
  ],
  "outputFormat": "MARC",
  "transformations": [
    {
      "fieldId": "electronicAccess.linkText",
      "path": "Json path for electronicAccess[*].linkText",
      "transformation": "001",
      "enabled": true,
      "recordType": "INSTANCE"
    }
  ],
  "userInfo": {
    "firstName": "User",
    "lastName": "User",
    "userName": "@username"
  },
  "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 mappingProfile -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create mappingProfiles -- 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/mappingProfiles

Retrieve a list of mappingProfile items.

GET /data-export/mappingProfiles
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 mappingProfile items

Body

Media type: application/json

Type: json

Content:

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

Example:

{
  "mappingProfiles": [
    {
      "id": "3798f546-7afb-11ea-bc55-0242ac130003",
      "name": "Example mapping profile",
      "description": "Example mapping profile description",
      "recordTypes": [
        "INSTANCE"
      ],
      "outputFormat": "MARC",
      "transformations": [
        {
          "fieldId": "electronicAccess.linkText",
          "path": "Json path for electronicAccess[*].linkText",
          "transformation": "001",
          "enabled": true,
          "recordType": "INSTANCE"
        }
      ],
      "userInfo": {
        "firstName": "User",
        "lastName": "User",
        "userName": "@username"
      },
      "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 mappingProfiles -- 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 mappingProfiles -- 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/mappingProfiles/{id}

Retrieve mappingProfile item with given {mappingProfileId}

GET /data-export/mappingProfiles/{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 mapping 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": "Mapping Profile schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Mapping Profile name",
      "type": "string"
    },
    "description": {
      "description": "Mapping Profile description",
      "type": "string"
    },
    "recordTypes": {
      "description": "Mapping Profile records type",
      "type": "array",
      "items": {
        "type": "string",
        "$ref": "recordTypes.json"
      }
    },
    "transformations": {
      "description": "List of mapping profile transformations",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "transformations.json"
      }
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Mapping Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "outputFormat": {
      "description": "Mapping Profile output format",
      "type": "string",
      "enum": [
        "MARC"
      ]
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "recordTypes"
  ]
}

Example:

{
  "id": "3798f546-7afb-11ea-bc55-0242ac130003",
  "name": "Mapping profile",
  "description": "Mapping profile description",
  "recordTypes": [
    "INSTANCE"
  ],
  "outputFormat": "MARC",
  "transformations": [
    {
      "fieldId": "electronicAccess.linkText",
      "path": "Json path for electronicAccess[*].linkText",
      "transformation": "001",
      "enabled": true,
      "recordType": "INSTANCE"
    }
  ],
  "userInfo": {
    "firstName": "User",
    "lastName": "User",
    "userName": "@username"
  },
  "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:

"mappingProfile 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/mappingProfiles/{id}

Delete mappingProfile item with given {mappingProfileId}

DELETE /data-export/mappingProfiles/{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 mapping 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 mappingProfile -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"mappingProfile 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/mappingProfiles/{id}

Update mappingProfile item with given {mappingProfileId}

PUT /data-export/mappingProfiles/{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 mapping 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": "Mapping Profile schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "description": "Unique identifier",
      "$ref": "../../raml-util/schemas/uuid.schema"
    },
    "name": {
      "description": "Mapping Profile name",
      "type": "string"
    },
    "description": {
      "description": "Mapping Profile description",
      "type": "string"
    },
    "recordTypes": {
      "description": "Mapping Profile records type",
      "type": "array",
      "items": {
        "type": "string",
        "$ref": "recordTypes.json"
      }
    },
    "transformations": {
      "description": "List of mapping profile transformations",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "transformations.json"
      }
    },
    "userInfo": {
      "description": "First name, last name and username of the user, who updated the Mapping Profile",
      "type": "object",
      "$ref": "userInfo.json"
    },
    "outputFormat": {
      "description": "Mapping Profile output format",
      "type": "string",
      "enum": [
        "MARC"
      ]
    },
    "metadata": {
      "description": "Metadata provided by the server",
      "type": "object",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "name",
    "recordTypes"
  ]
}

Example:

{
  "id": "3798f546-7afb-11ea-bc55-0242ac130003",
  "name": "Mapping profile",
  "description": "Mapping profile description",
  "recordTypes": [
    "INSTANCE"
  ],
  "outputFormat": "MARC",
  "transformations": [
    {
      "fieldId": "electronicAccess.linkText",
      "path": "Json path for electronicAccess[*].linkText",
      "transformation": "001",
      "enabled": true,
      "recordType": "INSTANCE"
    }
  ],
  "userInfo": {
    "firstName": "User",
    "lastName": "User",
    "userName": "@username"
  },
  "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 mappingProfile -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"mappingProfile 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