Counter Reports (v3.0)

http://localhost/mod-erm-usage

Table of contents

mod-erm-usage API

This documents the API calls that can be made to query and manage counter reports

Counter Reports

Collection of counter-report items.

GET /counter-reports

Get all reports. If query parameter tiny is set to true, the reports' metadata is returned without the actual counter reports.

GET /counter-reports
Query Parameters
  • tiny: (boolean - default: false)
  • 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.

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    yearMonth="2018-03" and reportName="JR1"
    
  • orderBy: (string)

    Order by field:

  • order: (one of desc, asc - default: desc)

    Order

  • 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. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example:

    10

Response 200

Returns a list of counter-report items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "List of CounterReports",
  "type": "object",
  "properties": {
    "counterReports": {
      "type": "array",
      "description": "Entries",
      "id": "counterReportData",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Counter Report and Metadata",
        "title": "Counter Report Schema",
        "properties": {
          "id": {
            "type": "string"
          },
          "downloadTime": {
            "description": "Date and time the report was downloaded",
            "type": "string",
            "format": "date-time"
          },
          "failedAttempts": {
            "description": "Count of failed download attempts",
            "type": "integer"
          },
          "failedReason": {
            "description": "Error message from failed download attempt",
            "type": "string"
          },
          "release": {
            "description": "Counter Report version",
            "type": "string"
          },
          "reportName": {
            "description": "Counter Report name",
            "type": "string"
          },
          "yearMonth": {
            "description": "Counter Report period (one month)",
            "type": "string",
            "format": "date-month"
          },
          "providerId": {
            "description": "Provider identifier",
            "type": "string"
          },
          "report": {
            "description": "Actual counter report data",
            "type": "object"
          },
          "metadata": {
            "description": "Metadata about creation and changes, provided by the server (client should not provide)",
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "metadata.schema",
            "title": "Metadata Schema",
            "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"
            ]
          },
          "reportEditedManually": {
            "description": "Report data has been edited manually",
            "type": "boolean"
          },
          "editReason": {
            "description": "Edit reason",
            "type": "string"
          }
        },
        "required": [
          "downloadTime",
          "release",
          "reportName",
          "yearMonth"
        ],
        "additionalProperties": true
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "counterReports",
    "totalRecords"
  ]
}

Example:

{
  "counterReports": [
    {
    	"id": "8c6b1c02-e153-4413-970b-1b1a3eca1328",
    	"downloadTime": "2018-09-13T12:57:01.414+0000",
    	"creationTime": "2018-09-13T12:57:01.414+0000",
    	"release": "4",
    	"reportName": "JR1",
    	"yearMonth": "2018-07",
    	"report": {},
    	"reportEditedManually": false,
      "editReason": ""
    },
    {
    	"id": "8c6b1c02-e153-4413-970b-1b1a3eca1330",
    	"downloadTime": "2018-09-13T12:57:01.414+0000",
    	"creationTime": "2018-09-13T12:57:01.414+0000",
    	"release": "5",
    	"reportName": "TR_J1",
    	"yearMonth": "2018-07",
    	"report": {},
    	"reportEditedManually": true,
      "editReason": "reason for manually editing"
    }
  ],
  "totalRecords": 2
}

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 counter-reports -- 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 counter-reports -- unauthorized

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /counter-reports

Post new report

POST /counter-reports
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Counter Report and Metadata",
  "title": "Counter Report Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "downloadTime": {
      "description": "Date and time the report was downloaded",
      "type": "string",
      "format": "date-time"
    },
    "failedAttempts": {
      "description": "Count of failed download attempts",
      "type": "integer"
    },
    "failedReason": {
      "description": "Error message from failed download attempt",
      "type": "string"
    },
    "release": {
      "description": "Counter Report version",
      "type": "string"
    },
    "reportName": {
      "description": "Counter Report name",
      "type": "string"
    },
    "yearMonth": {
      "description": "Counter Report period (one month)",
      "type": "string",
      "format": "date-month"
    },
    "providerId": {
      "description": "Provider identifier",
      "type": "string"
    },
    "report": {
      "description": "Actual counter report data",
      "type": "object"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "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"
      ]
    },
    "reportEditedManually": {
      "description": "Report data has been edited manually",
      "type": "boolean"
    },
    "editReason": {
      "description": "Edit reason",
      "type": "string"
    }
  },
  "required": [
    "downloadTime",
    "release",
    "reportName",
    "yearMonth"
  ],
  "additionalProperties": true
}

Example:

{
  "id": "7c0faed5-3ab6-4657-8179-fee651d6a569",
  "downloadTime": "2019-02-14T08:42:04.885+0000",
  "release": "4",
  "reportName": "JR1",
  "yearMonth": "2018-12",
  "providerId": "4b659cb9-e4bb-493d-ae30-5f5690c54802",
  "report": {
    "vendor": {
      "id": "SEM001",
      "name": "Semantico Ltd.",
      "contact": [
        {
          "email": "info@semantico.com",
          "contact": "tbc"
        }
      ],
      "logoUrl": "http://www.semantico.com/wp-content/themes/semantico/images/logo-new.png",
      "webSiteUrl": "http://www.semantico.com"
    },
    "created": "2019-02-11T12:35:45.066Z",
    "name": "Journal Report 1 (R4)",
    "id": "1549888545066",
    "title": "JR1:4",
    "version": "4",
    "customer": [
      {
        "id": "customer1234",
        "contact": [],
        "reportItems": [
          {
            "itemDate": [],
            "itemName": "19th-Century Music",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "University of California Press",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "1533-8606"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0148-2076"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 9,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "AA Files",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "Architectural Association School of Architecture",
            "itemIdentifier": [
              {
                "type": "PRINT_ISSN",
                "value": "0261-6823"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 7,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "ABA Journal",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "American Bar Association",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "2162-7983"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0747-0088"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 2,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          }
        ],
        "institutionalIdentifier": []
      }
    ]
  },
  "reportEditedManually": true,
  "editReason": "reason for manually editing"
}

Response 201

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

Headers
  • Location: required (string)

    URI to the created counter-report item

Body

Media type: application/json

Type: any

Example:

{
  "id": "7c0faed5-3ab6-4657-8179-fee651d6a569",
  "downloadTime": "2019-02-14T08:42:04.885+0000",
  "release": "4",
  "reportName": "JR1",
  "yearMonth": "2018-12",
  "providerId": "4b659cb9-e4bb-493d-ae30-5f5690c54802",
  "report": {
    "vendor": {
      "id": "SEM001",
      "name": "Semantico Ltd.",
      "contact": [
        {
          "email": "info@semantico.com",
          "contact": "tbc"
        }
      ],
      "logoUrl": "http://www.semantico.com/wp-content/themes/semantico/images/logo-new.png",
      "webSiteUrl": "http://www.semantico.com"
    },
    "created": "2019-02-11T12:35:45.066Z",
    "name": "Journal Report 1 (R4)",
    "id": "1549888545066",
    "title": "JR1:4",
    "version": "4",
    "customer": [
      {
        "id": "customer1234",
        "contact": [],
        "reportItems": [
          {
            "itemDate": [],
            "itemName": "19th-Century Music",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "University of California Press",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "1533-8606"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0148-2076"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 9,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "AA Files",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "Architectural Association School of Architecture",
            "itemIdentifier": [
              {
                "type": "PRINT_ISSN",
                "value": "0261-6823"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 7,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "ABA Journal",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "American Bar Association",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "2162-7983"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0747-0088"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 2,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          }
        ],
        "institutionalIdentifier": []
      }
    ]
  },
  "reportEditedManually": true,
  "editReason": "reason for manually editing"
}

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 counter-report -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create counter-reports -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.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#",
        "id": "error.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": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "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

GET /counter-reports/{id}

Get one report identified by id

GET /counter-reports/{id}
URI Parameters
  • id: required (string)

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": "Counter Report and Metadata",
  "title": "Counter Report Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "downloadTime": {
      "description": "Date and time the report was downloaded",
      "type": "string",
      "format": "date-time"
    },
    "failedAttempts": {
      "description": "Count of failed download attempts",
      "type": "integer"
    },
    "failedReason": {
      "description": "Error message from failed download attempt",
      "type": "string"
    },
    "release": {
      "description": "Counter Report version",
      "type": "string"
    },
    "reportName": {
      "description": "Counter Report name",
      "type": "string"
    },
    "yearMonth": {
      "description": "Counter Report period (one month)",
      "type": "string",
      "format": "date-month"
    },
    "providerId": {
      "description": "Provider identifier",
      "type": "string"
    },
    "report": {
      "description": "Actual counter report data",
      "type": "object"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "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"
      ]
    },
    "reportEditedManually": {
      "description": "Report data has been edited manually",
      "type": "boolean"
    },
    "editReason": {
      "description": "Edit reason",
      "type": "string"
    }
  },
  "required": [
    "downloadTime",
    "release",
    "reportName",
    "yearMonth"
  ],
  "additionalProperties": true
}

Example:

{
  "id": "7c0faed5-3ab6-4657-8179-fee651d6a569",
  "downloadTime": "2019-02-14T08:42:04.885+0000",
  "release": "4",
  "reportName": "JR1",
  "yearMonth": "2018-12",
  "providerId": "4b659cb9-e4bb-493d-ae30-5f5690c54802",
  "report": {
    "vendor": {
      "id": "SEM001",
      "name": "Semantico Ltd.",
      "contact": [
        {
          "email": "info@semantico.com",
          "contact": "tbc"
        }
      ],
      "logoUrl": "http://www.semantico.com/wp-content/themes/semantico/images/logo-new.png",
      "webSiteUrl": "http://www.semantico.com"
    },
    "created": "2019-02-11T12:35:45.066Z",
    "name": "Journal Report 1 (R4)",
    "id": "1549888545066",
    "title": "JR1:4",
    "version": "4",
    "customer": [
      {
        "id": "customer1234",
        "contact": [],
        "reportItems": [
          {
            "itemDate": [],
            "itemName": "19th-Century Music",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "University of California Press",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "1533-8606"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0148-2076"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 9,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "AA Files",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "Architectural Association School of Architecture",
            "itemIdentifier": [
              {
                "type": "PRINT_ISSN",
                "value": "0261-6823"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 7,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "ABA Journal",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "American Bar Association",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "2162-7983"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0747-0088"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 2,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          }
        ],
        "institutionalIdentifier": []
      }
    ]
  },
  "reportEditedManually": true,
  "editReason": "reason for manually editing"
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"counter-report 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 /counter-reports/{id}

Delete report identified by id

DELETE /counter-reports/{id}
URI Parameters
  • id: required (string)

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 counter-report -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"counter-report 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 /counter-reports/{id}

Put report identified by id

PUT /counter-reports/{id}
URI Parameters
  • id: required (string)
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Counter Report and Metadata",
  "title": "Counter Report Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "downloadTime": {
      "description": "Date and time the report was downloaded",
      "type": "string",
      "format": "date-time"
    },
    "failedAttempts": {
      "description": "Count of failed download attempts",
      "type": "integer"
    },
    "failedReason": {
      "description": "Error message from failed download attempt",
      "type": "string"
    },
    "release": {
      "description": "Counter Report version",
      "type": "string"
    },
    "reportName": {
      "description": "Counter Report name",
      "type": "string"
    },
    "yearMonth": {
      "description": "Counter Report period (one month)",
      "type": "string",
      "format": "date-month"
    },
    "providerId": {
      "description": "Provider identifier",
      "type": "string"
    },
    "report": {
      "description": "Actual counter report data",
      "type": "object"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "metadata.schema",
      "title": "Metadata Schema",
      "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"
      ]
    },
    "reportEditedManually": {
      "description": "Report data has been edited manually",
      "type": "boolean"
    },
    "editReason": {
      "description": "Edit reason",
      "type": "string"
    }
  },
  "required": [
    "downloadTime",
    "release",
    "reportName",
    "yearMonth"
  ],
  "additionalProperties": true
}

Example:

{
  "id": "7c0faed5-3ab6-4657-8179-fee651d6a569",
  "downloadTime": "2019-02-14T08:42:04.885+0000",
  "release": "4",
  "reportName": "JR1",
  "yearMonth": "2018-12",
  "providerId": "4b659cb9-e4bb-493d-ae30-5f5690c54802",
  "report": {
    "vendor": {
      "id": "SEM001",
      "name": "Semantico Ltd.",
      "contact": [
        {
          "email": "info@semantico.com",
          "contact": "tbc"
        }
      ],
      "logoUrl": "http://www.semantico.com/wp-content/themes/semantico/images/logo-new.png",
      "webSiteUrl": "http://www.semantico.com"
    },
    "created": "2019-02-11T12:35:45.066Z",
    "name": "Journal Report 1 (R4)",
    "id": "1549888545066",
    "title": "JR1:4",
    "version": "4",
    "customer": [
      {
        "id": "customer1234",
        "contact": [],
        "reportItems": [
          {
            "itemDate": [],
            "itemName": "19th-Century Music",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "University of California Press",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "1533-8606"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0148-2076"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 9,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "AA Files",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "Architectural Association School of Architecture",
            "itemIdentifier": [
              {
                "type": "PRINT_ISSN",
                "value": "0261-6823"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 5,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 7,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          },
          {
            "itemDate": [],
            "itemName": "ABA Journal",
            "itemDataType": "JOURNAL",
            "itemPlatform": "Ithaka",
            "itemAttribute": [],
            "itemPublisher": "American Bar Association",
            "itemIdentifier": [
              {
                "type": "ONLINE_ISSN",
                "value": "2162-7983"
              },
              {
                "type": "PRINT_ISSN",
                "value": "0747-0088"
              }
            ],
            "itemContributor": [],
            "itemPerformance": [
              {
                "period": {
                  "end": "2018-12-31",
                  "begin": "2018-12-01"
                },
                "category": "REQUESTS",
                "instance": [
                  {
                    "count": 2,
                    "metricType": "FT_HTML"
                  },
                  {
                    "count": 2,
                    "metricType": "FT_PDF"
                  },
                  {
                    "count": 4,
                    "metricType": "FT_TOTAL"
                  }
                ]
              }
            ]
          }
        ],
        "institutionalIdentifier": []
      }
    ]
  },
  "reportEditedManually": true,
  "editReason": "reason for manually editing"
}

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

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"counter-report 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: text/plain

Type: any

Example:

internal server error, contact administrator

GET /counter-reports/{id}/download

Download report in its original format

GET /counter-reports/{id}/download
URI Parameters
  • id: required (string)

Response 200

OK

Body

Media type: application/xml

Type: any

Media type: application/json

Type: any

Response 404

Not Found

Response 500

Server Error

Body

Media type: text/plain

Type: any

GET /counter-reports/sorted/{udpId}

Get counter reports sorted by year and report

GET /counter-reports/sorted/{udpId}
URI Parameters
  • udpId: required (string)

Response 200

counter reports sorted by year and report

Body

Media type: application/json

Example:

{
  "counterReportsPerYear": [
    {
      "year": 2019,
      "reportsPerType": [
        {
          "reportType": "PR",
          "counterReports": [
            {
              "id": "f6a2d16d-cf66-4a65-b112-859340b2bbf1",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "PR",
              "yearMonth": "2019-11",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            },
            {
              "id": "a0b749a3-5b9c-4ee1-824e-f77b35ae9ee6",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "PR",
              "yearMonth": "2019-05",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            }
          ]
        },
        {
          "reportType": "IR",
          "counterReports": [
            {
              "id": "9f5c2753-77a3-4b75-a006-d39c65150ca8",
              "downloadTime": "2019-02-14T08:42:04Z",
              "release": "5",
              "reportName": "IR",
              "yearMonth": "2019-01",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            },
            {
              "id": "32a887eb-e5ec-41c4-9a83-fd114471a9d2",
              "downloadTime": "2019-02-14T08:42:04Z",
              "release": "5",
              "reportName": "IR",
              "yearMonth": "2019-02",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            }
          ]
        }
      ]
    },
    {
      "year": 2018,
      "reportsPerType": [
        {
          "reportType": "PR",
          "counterReports": [
            {
              "id": "f047e5b3-e957-4f66-a00d-f77fc4b32870",
              "downloadTime": "2019-02-14T08:42:04Z",
              "release": "5",
              "reportName": "PR",
              "yearMonth": "2018-08",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            },
            {
              "id": "1a7034bf-b817-4c1e-b56b-35fa88f76d88",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "PR",
              "yearMonth": "2018-10",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            }
          ]
        },
        {
          "reportType": "IR",
          "counterReports": [
            {
              "id": "a943de5f-2d74-4167-a79e-ce1cf2bf40cd",
              "downloadTime": "2019-02-14T08:42:04Z",
              "release": "5",
              "reportName": "IR",
              "yearMonth": "2018-10",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            },
            {
              "id": "2140e3d1-b5b4-48d6-b542-f5b7ac46e0a0",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "IR",
              "yearMonth": "2018-05",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc"
            }
          ]
        }
      ]
    },
    {
      "year": 2020,
      "reportsPerType": [
        {
          "reportType": "PR",
          "counterReports": [
            {
              "id": "33e780f6-db27-4a33-bdaf-aeeb1523ae57",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "PR",
              "yearMonth": "2020-01",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc",
              "reportEditedManually": true,
              "editReason": "reason for manually editing"
            }
          ]
        },
        {
          "reportType": "IR",
          "counterReports": [
            {
              "id": "8f1c7f13-6f95-4811-81be-0285c331063a",
              "downloadTime": "2019-02-14T08:42:04Z",
              "failedAttempts": 2,
              "failedReason": "[{\"Code\":1020,\"Severity\":\"Fatal\",\"Message\":\"Client has made too many requests\",\"Data\":\"Please request reports sequentially once per second. Simultaneous requests are not supported.\"}]",
              "release": "5",
              "reportName": "IR",
              "yearMonth": "2020-01",
              "providerId": "5aac21f2-1791-4b21-8ae3-f6a9013f42dc",
              "reportEditedManually": false,
              "editReason": ""
            }
          ]
        }
      ]
    }
  ]
}

Response 400

Body

Media type: text/plain

Type: any

Response 500

Body

Media type: text/plain

Type: any

GET /counter-reports/export/{id}

Get the report identified by id as specified format (default is CSV)

GET /counter-reports/export/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • format: (string - default: csv)

Response 200

Body

Media type: text/csv

Type: any

Media type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: any

Response 400

Body

Media type: text/plain

Type: any

Response 404

Response 422

Body

Media type: text/plain

Type: any

Response 500

Server Error

Body

Media type: text/plain

Type: any

GET /counter-reports/export/provider/{id}/report/{name}/version/{aversion}/from/{begin}/to/{end}

Get report for several months as specified format (default is CSV)

GET /counter-reports/export/provider/{id}/report/{name}/version/{aversion}/from/{begin}/to/{end}
URI Parameters
  • id: required (string)
  • name: required (string)
  • aversion: required (string)
  • begin: required (string)
  • end: required (string)
Query Parameters
  • format: (string - default: csv)

Response 200

Body

Media type: text/csv

Type: any

Media type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Type: any

Response 400

Body

Media type: text/plain

Type: any

Response 500

Server Error

Body

Media type: text/plain

Type: any

POST /counter-reports/multipartupload/provider/{id}

POST /counter-reports/multipartupload/provider/{id}
URI Parameters
  • id: required (string)
Query Parameters
  • overwrite: required (boolean - default: false)

    Overwrite existing reports?

Body

Media type: multipart/form-data

Type: any

Response 200

Body

Media type: text/plain

Type: any

Response 400

Body

Media type: text/plain

Type: any

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.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#",
        "id": "error.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": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "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

Body

Media type: text/plain

Type: any

GET /counter-reports/errors/codes

Get counter/sushi error codes existent in counter reports

GET /counter-reports/errors/codes

Response 200

error codes existent in counter reports

Body

Media type: application/json

Example:

{
  "errorCodes": ["3000", "3030"]
}

Response 500

Body

Media type: text/plain

Type: any

GET /counter-reports/reports/types

Get report types of available counter reports

GET /counter-reports/reports/types

Response 200

available report types

Body

Media type: application/json

Example:

{
  "reportTypes": ["DR", "PR", "TR"]
}

Response 500

Body

Media type: text/plain

Type: any

GET /counter-reports/reports/releases

Get report release versions of available counter reports

GET /counter-reports/reports/releases

Response 200

available report release versions

Body

Media type: application/json

Example:

{
  "reportReleases": ["4", "5", "5.1"]
}

Response 500

Body

Media type: text/plain

Type: any

POST /counter-reports/reports/delete

Delete multiple counter reports

POST /counter-reports/reports/delete
Body

Media type: application/json

Type: array of items

Example:

[
  "e05e1089-7810-4f07-844f-5c4b8db7395e",
  "ed05a906-c36e-4c3b-a37d-2a52ca8580da"
]

Response 204

Response 400

Body

Media type: text/plain

Type: any

Response 500

Body

Media type: text/plain

Type: any