Data export (v1.0)

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

Table of contents

Data export Error Logs API

APIs for managing Error Logs

/data-export/logs

Service provides APIs supporting Error logs

GET /data-export/logs

Retrieve log item with given {logId}

GET /data-export/logs
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
    
    jobExecutionId=67dfac11-1caf-4470-9ad1-d533f6360bdd
    
  • 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": "Collection of Error Logs",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "errorLogs": {
      "description": "List of Error Logs",
      "type": "array",
      "id": "errorLogList",
      "items": {
        "type": "object",
        "$ref": "errorLog.json"
      }
    },
    "totalRecords": {
      "description": "Total number of Error Logs",
      "type": "integer"
    }
  },
  "required": [
    "errorLogs",
    "totalRecords"
  ]
}

Example:

{
    "errorLogs": [
        {
            "id": "de55d20e-4daf-49bf-8bf0-ae7eada8b80c",
            "jobExecutionId": "67dfac11-1caf-4470-9ad1-d533f6360bdd",
            "createdDate": "2019-07-22T11:22:07Z",
            "logLevel": "ERROR",
            "reason": 200,
            "affectedRecords": [{
                "id": "57c79d87-6510-4354-b212-96832fbf3fa1",
                "hrid": "200",
                "title": "Record title",
                "recordType": "INSTANCE"
            }],
            "metadata": {
                "createdDate": "2019-09-15T11:22:07Z",
                "createdByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b",
                "createdByUsername": "janedoeuser",
                "updatedDate": "2019-09-15T13:28:54Z",
                "updatedByUserId": "dee12548-9cee-45fa-bbae-675c1cc0ce3b",
                "updatedByUsername": ""
            }
        },
        "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 logs -- 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 logs -- unauthorized"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"log not found"

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",
        "$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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator