Batch voucher export configurations (v1.1)

http://github.com/folio-org/mod-invoice

Table of contents

Batch voucher export configurations CRUD API

This documents the API calls that can be made to manage batch voucher export configurations

/batch-voucher/export-configurations

Collection of export-configuration items.

GET /batch-voucher/export-configurations

Get list of batch voucher export configurations

GET /batch-voucher/export-configurations
Query Parameters
  • totalRecords: (string - default: auto - pattern: exact|estimated|none|auto)

    How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    none
  • 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: for example format

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    format=="Application/xml"
    

Response 200

Returns a list of export-configuration items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of batch voucher export configurations",
  "type": "object",
  "properties": {
    "exportConfigs": {
      "description": "an array of batch voucher export configuration records",
      "id": "exportConfigs",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
        "properties": {
          "id": {
            "description": "UUID of the configuration record",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "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}$"
          },
          "batchGroupId": {
            "description": "UUID of the batch group this configuration is associated with",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "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}$"
          },
          "enableScheduledExport": {
            "description": "Whether or not to enable scheduled batch voucher exports",
            "type": "boolean",
            "default": false
          },
          "format": {
            "description": "Desired format (MIME type) of the batch voucher",
            "type": "string",
            "enum": [
              "Application/json",
              "Application/xml"
            ],
            "default": "Application/json"
          },
          "startTime": {
            "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
            "type": "string",
            "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
            "default": "00:00"
          },
          "uploadURI": {
            "description": "Host where batch vouchers should be uploaded to. Limited to FTP initially",
            "type": "string"
          },
          "uploadDirectory": {
            "description": "The upload directory",
            "type": "string"
          },
          "ftpFormat": {
            "description": "The FTP format",
            "type": "string",
            "enum": [
              "SFTP",
              "FTP"
            ]
          },
          "ftpPort": {
            "description": "The ftp port",
            "type": "integer"
          },
          "weekdays": {
            "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Sunday",
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday"
              ],
              "uniqueItems": true
            }
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "batchGroupId"
        ]
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "exportConfigs",
    "totalRecords"
  ]
}

Example:

{
  "exportConfigs": [
    {
      "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
      "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
      "startTime": "00:00",
      "weekdays": [ "Monday", "Wednesday" ],
      "enableScheduledExport": true,
      "format": "Application/xml",
      "uploadURI": "ftp://ftp.amherst-lib.edu/invoices/",
      "metadata": {
        "createdDate": "2020-01-28T00:12:04.000+0000",
        "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
      }
    }
  ],
  "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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to list export-configurations -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to list export-configurations -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /batch-voucher/export-configurations

Create a new export-configuration item.

POST /batch-voucher/export-configurations
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "Host where batch vouchers should be uploaded to. Limited to FTP initially",
      "type": "string"
    },
    "uploadDirectory": {
      "description": "The upload directory",
      "type": "string"
    },
    "ftpFormat": {
      "description": "The FTP format",
      "type": "string",
      "enum": [
        "SFTP",
        "FTP"
      ]
    },
    "ftpPort": {
      "description": "The ftp port",
      "type": "integer"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp.amherst-lib.edu",
  "uploadDirectory": "/files/invoices",
  "ftpFormat": "SFTP",
  "ftpPort": 22,
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created export-configuration item

Body

Media type: application/json

Type: any

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp.amherst-lib.edu",
  "uploadDirectory": "/files/invoices",
  "ftpFormat": "SFTP",
  "ftpPort": 22,
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to add export-configuration -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

unable to create export-configurations -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /batch-voucher/export-configurations/{id}

Retrieve export-configuration item with given {export-configurationId}

GET /batch-voucher/export-configurations/{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 batch voucher export configuration

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": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "Host where batch vouchers should be uploaded to. Limited to FTP initially",
      "type": "string"
    },
    "uploadDirectory": {
      "description": "The upload directory",
      "type": "string"
    },
    "ftpFormat": {
      "description": "The FTP format",
      "type": "string",
      "enum": [
        "SFTP",
        "FTP"
      ]
    },
    "ftpPort": {
      "description": "The ftp port",
      "type": "integer"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp.amherst-lib.edu",
  "uploadDirectory": "/files/invoices",
  "ftpFormat": "SFTP",
  "ftpPort": 22,
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"export-configuration not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /batch-voucher/export-configurations/{id}

Delete export-configuration item with given {export-configurationId}

DELETE /batch-voucher/export-configurations/{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 batch voucher export configuration

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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to delete export-configuration -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"export-configuration not found"

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /batch-voucher/export-configurations/{id}

Update export-configuration item with given {export-configurationId}

PUT /batch-voucher/export-configurations/{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 batch voucher export configuration

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Configuration information for a voucher export - there's only one of these for a given batchGroup",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the configuration record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "batchGroupId": {
      "description": "UUID of the batch group this configuration is associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "enableScheduledExport": {
      "description": "Whether or not to enable scheduled batch voucher exports",
      "type": "boolean",
      "default": false
    },
    "format": {
      "description": "Desired format (MIME type) of the batch voucher",
      "type": "string",
      "enum": [
        "Application/json",
        "Application/xml"
      ],
      "default": "Application/json"
    },
    "startTime": {
      "description": "The time of day to trigger an export if enableDailyExport == true.  Format: HH:MM",
      "type": "string",
      "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3])[:][0-5][0-9]$",
      "default": "00:00"
    },
    "uploadURI": {
      "description": "Host where batch vouchers should be uploaded to. Limited to FTP initially",
      "type": "string"
    },
    "uploadDirectory": {
      "description": "The upload directory",
      "type": "string"
    },
    "ftpFormat": {
      "description": "The FTP format",
      "type": "string",
      "enum": [
        "SFTP",
        "FTP"
      ]
    },
    "ftpPort": {
      "description": "The ftp port",
      "type": "integer"
    },
    "weekdays": {
      "description": "An array of weekdays (enum: Sunday, Monday, etc.) indicating which days to trigger exports on.  If empty, indicates daily exports",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday"
        ],
        "uniqueItems": true
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "batchGroupId"
  ]
}

Example:

{
  "id": "3e3a52b2-9097-49ad-8ff1-8135af0db573",
  "batchGroupId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "startTime": "00:00",
  "weekdays": [ "Monday", "Wednesday" ],
  "enableScheduledExport": true,
  "format": "Application/xml",
  "uploadURI": "ftp.amherst-lib.edu",
  "uploadDirectory": "/files/invoices",
  "ftpFormat": "SFTP",
  "ftpPort": 22,
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"unable to update export-configuration -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

"export-configuration not found"

Response 409

Optimistic locking version conflict

Body

Media type: text/plain

Type: any

Example:

version conflict

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: application/json

Type: any

Example:

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

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /batch-voucher/export-configurations/{id}/credentials

Create a credentials record

POST /batch-voucher/export-configurations/{id}/credentials
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 batch voucher export configuration

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 201

Returns the newly created credentials, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created credentials

Body

Media type: application/json

Type: any

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

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 credentials -- malformed JSON at 13:3

Media type: application/json

Type: any

Example:

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

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create credentials -- unauthorized

Media type: application/json

Type: any

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

Media type: application/json

Type: any

Example:

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

GET /batch-voucher/export-configurations/{id}/credentials

Get the credentials for the specified export_configuration

GET /batch-voucher/export-configurations/{id}/credentials
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 batch voucher export configuration

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": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

Credentials not found

Media type: application/json

Type: any

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

Media type: application/json

Type: any

Example:

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

PUT /batch-voucher/export-configurations/{id}/credentials

Edit a credentials record

PUT /batch-voucher/export-configurations/{id}/credentials
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 batch voucher export configuration

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Credentials used to upload batch vouchers.  Part of the batch voucher export configuration, but separated for security reasons",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this credentials record",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "username": {
      "description": "The username portion of these credentials",
      "type": "string"
    },
    "password": {
      "description": "The password portion of these credentials",
      "type": "string"
    },
    "exportConfigId": {
      "description": "UUID of the batch voucher export configuration record these credentials as associated with",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "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}$"
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "exportConfigId",
    "username"
  ]
}

Example:

{
  "id": "574f0791-beca-4470-8037-050660cfb73a",
  "exportConfigId": "e91d44e4-ae4f-401a-b355-3ea44f57a628",
  "username": "jsmith",
  "password": "letmein",
  "metadata": {
    "createdDate": "2020-01-28T00:12:04.000+0000",
    "createdByUserId": "28d1057c-d137-11e8-a8d5-f2801f1b9fd1"
  }
}

Response 204

Credentials 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 Credentials -- malformed JSON at 13:4"

Media type: application/json

Type: any

Example:

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

Response 404

Credentials with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"Voucher not found"

Media type: application/json

Type: any

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

Media type: application/json

Type: any

Example:

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

POST /batch-voucher/export-configurations/{id}/credentials/test

Test that you can connect to and log into the uploadURI with the configured credentials

POST /batch-voucher/export-configurations/{id}/credentials/test
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 batch voucher export configuration

Response 200

Return message from FTP server

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Message with free-form text",
  "type": "object",
  "properties": {
    "message": {
      "description": "Free-form text",
      "type": "string"
    }
  },
  "additionalProperties": false
}

Example:

{
  "message" : "Free-form text"
}