mod-kb-ebsco-java version v1
https://github.com/folio-org/mod-kb-ebsco-java
mod-kb-ebsco-java
Implements the eholdings interface using EBSCO KB as backend.
Usage Consolidation settings
Retrieve a Usage Consolidation settings.
Create a new Usage Consolidation Settings
Create a new Usage Consolidation Settings
get /eholdings/kb-credentials/{id}/uc
Retrieve a Usage Consolidation settings.
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}$)
Query Parameters
- metrictype: (boolean - default: false)
Indicates that metric type should be included
HTTP status code 200
OK
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings object schema",
"description": "Usage Consolidation Settings object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCSettings",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettings"
],
"example": "ucSettings"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsDataAttributes",
"additionalProperties": false,
"extends": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"description": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKeyDataAttributes",
"additionalProperties": false,
"type": "object",
"properties": {
"credentialsId": {
"type": "string",
"description": "The UUID of credentials",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
}
},
"required": [
"customerKey"
]
},
"properties": {
"startMonth": {
"type": "string",
"description": "Fiscal starting month",
"example": "jan",
"default": "jan",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.Month",
"enum": [
"jan",
"feb",
"mar",
"apr",
"may",
"jun",
"jul",
"aug",
"sep",
"oct",
"nov",
"dec"
]
},
"currency": {
"type": "string",
"description": "Currency",
"examples": "USD"
},
"platformType": {
"type": "string",
"description": "Type of platform",
"example": "publisher",
"default": "all",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.PlatformType",
"enum": [
"publisher",
"nonPublisher",
"all"
]
},
"metricType": {
"type": "string",
"description": "Metric usage type",
"readonly": true,
"enum": [
"Total Item Requests",
"Unique Item Requests",
"Unknown"
],
"javaEnumNames": [
"TOTAL",
"UNIQUE",
"UNKNOWN"
]
}
},
"required": [
"currency"
]
},
"meta": {
"type": "object",
"description": "Metadata about creation and changes to item",
"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"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"type": "ucSettings",
"attributes": {
"customerKey": "****************************************",
"startMonth": "jan",
"currency": "USD",
"platformType": "all"
},
"metadata": {
"createdDate": "2020-03-17T15:22:04.098",
"updatedDate": "2020-03-17T15:23:04.098+0000",
"createdByUserId": "1f8f660e-7dc9-4f6f-828f-96284c68a250",
"updatedByUserId": "6893f51f-b40c-479d-bd78-1704ab5b802b",
"createdByUsername": "john_doe",
"updatedByUsername": "jane_doe"
}
}
HTTP status code 404
Not Found
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Usage Consolidation is not enabled for KB credentials with id [2ffa1940-2cf6-48b1-8cc9-5e539c61d93f]"
}
],
"jsonapi": {
"version": "1.0"
}
}
post /eholdings/kb-credentials/{id}/uc
Create a new Usage Consolidation Settings
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}$)
Headers
- Content-Type: required(string)
Example:
application/vnd.api+json
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Post Request object schema",
"description": "Usage Consolidation Settings Post Request object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsPostRequest",
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"description": "Usage Consolidation Post Request Settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Post Request Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsPostDataAttributes",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettings"
],
"example": "ucSettings"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation Post Request Settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsDataAttributes",
"additionalProperties": false,
"extends": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"description": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKeyDataAttributes",
"additionalProperties": false,
"type": "object",
"properties": {
"credentialsId": {
"type": "string",
"description": "The UUID of credentials",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
}
},
"required": [
"customerKey"
]
},
"properties": {
"startMonth": {
"type": "string",
"description": "Fiscal starting month",
"example": "jan",
"default": "jan",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.Month",
"enum": [
"jan",
"feb",
"mar",
"apr",
"may",
"jun",
"jul",
"aug",
"sep",
"oct",
"nov",
"dec"
]
},
"currency": {
"type": "string",
"description": "Currency",
"examples": "USD"
},
"platformType": {
"type": "string",
"description": "Type of platform",
"example": "publisher",
"default": "all",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.PlatformType",
"enum": [
"publisher",
"nonPublisher",
"all"
]
},
"metricType": {
"type": "string",
"description": "Metric usage type",
"readonly": true,
"enum": [
"Total Item Requests",
"Unique Item Requests",
"Unknown"
],
"javaEnumNames": [
"TOTAL",
"UNIQUE",
"UNKNOWN"
]
}
},
"required": [
"currency"
]
},
"meta": {
"type": "object",
"description": "Creation Metadata",
"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"
]
}
},
"required": [
"type",
"attributes"
]
}
},
"required": [
"data"
]
}
Example:
{
"data": {
"type": "ucSettings",
"attributes": {
"customerKey": "ZZZZ",
"startMonth": "jan",
"currency": "USD",
"platformType" : "all"
}
}
}
HTTP status code 201
Created
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings object schema",
"description": "Usage Consolidation Settings object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCSettings",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettings"
],
"example": "ucSettings"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsDataAttributes",
"additionalProperties": false,
"extends": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"description": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKeyDataAttributes",
"additionalProperties": false,
"type": "object",
"properties": {
"credentialsId": {
"type": "string",
"description": "The UUID of credentials",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
}
},
"required": [
"customerKey"
]
},
"properties": {
"startMonth": {
"type": "string",
"description": "Fiscal starting month",
"example": "jan",
"default": "jan",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.Month",
"enum": [
"jan",
"feb",
"mar",
"apr",
"may",
"jun",
"jul",
"aug",
"sep",
"oct",
"nov",
"dec"
]
},
"currency": {
"type": "string",
"description": "Currency",
"examples": "USD"
},
"platformType": {
"type": "string",
"description": "Type of platform",
"example": "publisher",
"default": "all",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.PlatformType",
"enum": [
"publisher",
"nonPublisher",
"all"
]
},
"metricType": {
"type": "string",
"description": "Metric usage type",
"readonly": true,
"enum": [
"Total Item Requests",
"Unique Item Requests",
"Unknown"
],
"javaEnumNames": [
"TOTAL",
"UNIQUE",
"UNKNOWN"
]
}
},
"required": [
"currency"
]
},
"meta": {
"type": "object",
"description": "Metadata about creation and changes to item",
"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"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"type": "ucSettings",
"attributes": {
"name": "****************************************",
"startMonth": "jan",
"currency": "USD",
"platformType": "all"
},
"metadata": {
"createdDate": "2020-03-17T15:22:04.098",
"updatedDate": "2020-03-17T15:23:04.098+0000",
"createdByUserId": "1f8f660e-7dc9-4f6f-828f-96284c68a250",
"updatedByUserId": "1f8f660e-7dc9-4f6f-828f-96284c68a250",
"createdByUsername": "john_doe",
"updatedByUsername": "jane_doe"
}
}
HTTP status code 400
Bad Request
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"message": "must not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "data.attributes",
"value": "null"
}
]
}
]
}
HTTP status code 422
Unprocessable Entity
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Invalid UC Credentials"
}
],
"jsonapi": {
"version": "1.0"
}
}
patch /eholdings/kb-credentials/{id}/uc
Create a new Usage Consolidation Settings
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}$)
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Patch Request Schema",
"description": "Usage Consolidation Settings Patch Request Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsPatchRequest",
"additionalProperties": false,
"type": "object",
"properties": {
"data": {
"type": "object",
"description": "Patch request data object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Patch Request Data Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsPatchRequestData",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettings"
],
"example": "ucSettings"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Patch Request Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsPatchRequestDataAttributes",
"additionalProperties": false,
"properties": {
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
},
"startMonth": {
"type": "string",
"description": "Fiscal starting month",
"example": "jan",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.Month",
"enum": [
"jan",
"feb",
"mar",
"apr",
"may",
"jun",
"jul",
"aug",
"sep",
"oct",
"nov",
"dec"
]
},
"currency": {
"type": "string",
"description": "Currency",
"examples": "USD"
},
"platformType": {
"type": "string",
"description": "Type of platform",
"example": "publisher",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.PlatformType",
"enum": [
"publisher",
"nonPublisher",
"all"
]
}
}
}
},
"required": [
"type",
"attributes"
]
}
},
"required": [
"data"
]
}
Example:
{
"data": {
"type": "ucSettings",
"attributes": {
"customerKey": "ZZZZ"
}
}
}
HTTP status code 204
No Content
HTTP status code 404
Bad Request
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Usage Consolidation is not enabled for KB credentials with id [2ffa1940-2cf6-48b1-8cc9-5e539c61d93f]"
}
],
"jsonapi": {
"version": "1.0"
}
}
HTTP status code 422
Unprocessable Entity
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Invalid Usage Consolidation ID"
}
],
"jsonapi": {
"version": "1.0"
}
}
Retrieve a Usage Consolidation settings customer key.
get /eholdings/kb-credentials/{id}/uc/key
Retrieve a Usage Consolidation settings customer key.
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}$)
HTTP status code 200
OK
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key object schema",
"description": "Usage Consolidation Settings Customer Key object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKey",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettingsKey"
],
"example": "ucSettingsKey"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation settings customer key attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKeyDataAttributes",
"additionalProperties": false,
"properties": {
"credentialsId": {
"type": "string",
"description": "The UUID of credentials",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
}
},
"required": [
"customerKey"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"type": "ucSettingsKey",
"attributes": {
"credentialsId": "1f8f660e-7dc9-4f6f-828f-96284c68a250",
"customerKey": "customer_key"
}
}
HTTP status code 404
Not Found
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Usage Consolidation is not enabled for KB credentials with id [2ffa1940-2cf6-48b1-8cc9-5e539c61d93f]"
}
],
"jsonapi": {
"version": "1.0"
}
}
Usage Consolidation settings
Retrieve a Usage Consolidation settings.
get /eholdings/uc
Retrieve a Usage Consolidation settings.
Query Parameters
- metrictype: (boolean - default: false)
Indicates that metric type should be included
HTTP status code 200
OK
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings object schema",
"description": "Usage Consolidation Settings object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCSettings",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The UUID of entry",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucSettings"
],
"example": "ucSettings"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation settings attributes",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsDataAttributes",
"additionalProperties": false,
"extends": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"description": "Usage Consolidation Settings Customer Key Data Attributes Schema",
"javaType": "org.folio.rest.jaxrs.model.UCSettingsKeyDataAttributes",
"additionalProperties": false,
"type": "object",
"properties": {
"credentialsId": {
"type": "string",
"description": "The UUID of credentials",
"examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "uuid.schema",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"customerKey": {
"type": "string",
"description": "Encrypted customer ID",
"examples": "NS12345TS"
}
},
"required": [
"customerKey"
]
},
"properties": {
"startMonth": {
"type": "string",
"description": "Fiscal starting month",
"example": "jan",
"default": "jan",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.Month",
"enum": [
"jan",
"feb",
"mar",
"apr",
"may",
"jun",
"jul",
"aug",
"sep",
"oct",
"nov",
"dec"
]
},
"currency": {
"type": "string",
"description": "Currency",
"examples": "USD"
},
"platformType": {
"type": "string",
"description": "Type of platform",
"example": "publisher",
"default": "all",
"$schema": "http://json-schema.org/draft-04/schema#",
"javaType": "org.folio.rest.jaxrs.model.PlatformType",
"enum": [
"publisher",
"nonPublisher",
"all"
]
},
"metricType": {
"type": "string",
"description": "Metric usage type",
"readonly": true,
"enum": [
"Total Item Requests",
"Unique Item Requests",
"Unknown"
],
"javaEnumNames": [
"TOTAL",
"UNIQUE",
"UNKNOWN"
]
}
},
"required": [
"currency"
]
},
"meta": {
"type": "object",
"description": "Metadata about creation and changes to item",
"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"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
"type": "ucSettings",
"attributes": {
"customerKey": "****************************************",
"startMonth": "jan",
"currency": "USD",
"platformType": "all"
},
"metadata": {
"createdDate": "2020-03-17T15:22:04.098",
"updatedDate": "2020-03-17T15:23:04.098+0000",
"createdByUserId": "1f8f660e-7dc9-4f6f-828f-96284c68a250",
"updatedByUserId": "6893f51f-b40c-479d-bd78-1704ab5b802b",
"createdByUsername": "john_doe",
"updatedByUsername": "jane_doe"
}
}
HTTP status code 404
Not Found
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Usage Consolidation is not enabled for KB credentials with id [2ffa1940-2cf6-48b1-8cc9-5e539c61d93f]"
}
],
"jsonapi": {
"version": "1.0"
}
}
Usage Consolidation credentials
Check if Usage Consolidation credentials exists.
Update Usage Consolidation credentials
get /eholdings/uc-credentials
Check if Usage Consolidation credentials exists.
HTTP status code 200
OK
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Credentials Presence object schema",
"description": "Usage Consolidation Credentials Presence object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCCredentialsPresence",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucCredentialsPresence"
],
"example": "ucCredentialsPresence"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation credentials presence attributes",
"javaType": "org.folio.rest.jaxrs.model.UCCredentialsPresenceAttributes",
"additionalProperties": false,
"properties": {
"isPresent": {
"type": "boolean",
"description": "Indicates that Usage Consolidation credentials exist in the system",
"example": true
}
},
"required": [
"isPresent"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"type": "ucCredentials",
"attributes": {
"isPresent": true
}
}
put /eholdings/uc-credentials
Update Usage Consolidation credentials
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Credentials object schema",
"description": "Usage Consolidation Credentials object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCCredentials",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"description": "Type of resource",
"enum": [
"ucCredentials"
],
"example": "ucCredentials"
},
"attributes": {
"type": "object",
"description": "Usage Consolidation credentials attributes",
"javaType": "org.folio.rest.jaxrs.model.UCCredentialsAttributes",
"additionalProperties": false,
"properties": {
"clientId": {
"type": "string",
"description": "Client ID",
"example": "client-101"
},
"clientSecret": {
"type": "string",
"description": "Client API key",
"example": "client-101-api-key"
}
},
"required": [
"clientId",
"clientSecret"
]
}
},
"required": [
"type",
"attributes"
]
}
Example:
{
"data": {
"type": "ucCredentials",
"attributes": {
"clientId": "client-101",
"clientSecret": "client-101-api-key"
}
}
}
HTTP status code 204
No Content
HTTP status code 422
Unprocessable Entity
Body
Media type: application/vnd.api+json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response Schema",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiError",
"type": "object",
"additionalProperties": false,
"properties": {
"errors": {
"type": "array",
"description": "Error Response List",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Error Response object",
"description": "Error Response Schema for JSON API",
"javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Error Message Title",
"example": "Invalid KB API Credentials"
},
"detail": {
"type": "string",
"description": "Error Message Detail",
"example": "Kb api credentials are invalid"
},
"source": {
"type": "object",
"description": "Source of Error Message",
"example": {}
}
}
}
},
"jsonapi": {
"type": "object",
"description": "JSON API Version",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON API Version Schema",
"javaType": "org.folio.rest.jaxrs.model.JsonAPI",
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"description": "Version of json api being used",
"example": "1.0"
}
},
"required": [
"version"
]
}
}
}
Example:
{
"errors": [
{
"title": "Invalid Usage Consolidation ID"
}
],
"jsonapi": {
"version": "1.0"
}
}
Get Usage Consolidation client id
get /eholdings/uc-credentials/clientId
Get Usage Consolidation client id
HTTP status code 200
OK
Body
Media type: text/plain
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Credentials Client ID object schema",
"description": "Usage Consolidation Credentials Client ID object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCCredentialsClientId",
"additionalProperties": false,
"properties": {
"clientId": {
"type": "string",
"description": "Client ID",
"example": "client-101"
}
},
"required": [
"clientId"
]
}
Example:
{
"clientId": "clientId"
}
Get Usage Consolidation client secret
get /eholdings/uc-credentials/clientSecret
Get Usage Consolidation client secret
HTTP status code 200
OK
Body
Media type: text/plain
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Usage Consolidation Credentials Client Secret object schema",
"description": "Usage Consolidation Credentials Client Secret object schema",
"type": "object",
"javaType": "org.folio.rest.jaxrs.model.UCCredentialsClientSecret",
"additionalProperties": false,
"properties": {
"clientSecret": {
"type": "string",
"description": "Client API key",
"example": "client-101-api-key"
}
},
"required": [
"clientSecret"
]
}
Example:
{
"clientSecret": "client-101-api-key"
}