mod-kb-ebsco-java (v1)

https://github.com/folio-org/mod-kb-ebsco-java

Table of contents

mod-kb-ebsco-java

Implements the eholdings interface using EBSCO KB as backend.

KB Credetntials

GET /eholdings/kb-credentials

Get a collection of KB credentials.

GET /eholdings/kb-credentials

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "KB Credentials Collection Schema",
  "description": "KB Credentials Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentialsCollection",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Collection of KB Credentials",
      "items": {
        "type": "object",
        "$ref": "kbCredentials.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata containing total size of collection",
      "$ref": "../metaTotalResults.json",
      "readonly": true
    },
    "jsonapi": {
      "type": "object",
      "description": "Version of JSON:API",
      "$ref": "../jsonapi.json"
    }
  },
  "required": ["data", "meta", "jsonapi"]
}

Example:

{
  "data": [
    {
      "id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
      "type": "kbCredentials",
      "attributes": {
        "name": "University of Massachusetts",
        "apiKey": "****************************************",
        "url": "YYYY",
        "customerId": "ZZZZ"
      },
      "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"
      }
    }
  ],
  "meta": {
    "totalResults": 1
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /eholdings/kb-credentials

Create KB credentials

POST /eholdings/kb-credentials
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": "POST Request To KB Credentials Collection Schema",
  "description": "POST Request To KB Credentials Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentialsPostRequest",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "KB Credentials object",
      "$ref": "kbCredentials.json"
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "type": "kbCredentials",
    "attributes": {
      "name": "University of Massachusetts",
      "apiKey": "XXXX",
      "url": "YYYY",
      "customerId": "ZZZZ"
    }
  }
}

Response 201

Created

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "KB Credentials Collection Item Schema",
  "description": "KB Credentials Collection Item Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentials",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of entry",
      "$ref": "../../raml-util/schemas/uuid.schema",
      "examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
    },
    "type": {
      "type": "string",
      "description": "Type of resource",
      "enum": ["kbCredentials"],
      "example": "kbCredentials"
    },
    "attributes": {
      "type": "object",
      "description": "KB credentials collection item attributes",
      "$ref": "kbCredentialsDataAttributes.json"
    },
    "meta": {
      "type": "object",
      "description": "Metadata about creation and changes to item",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "type",
    "attributes"
  ]
}

Example:

{
  "id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
  "type": "kbCredentials",
  "attributes": {
    "name": "University of Massachusetts",
    "apiKey": "****************************************",
    "url": "YYYY",
    "customerId": "ZZZZ"
  },
  "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"
  }
}

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "duplicate key value violates unique constraint \"kb_credentials_pkey\"",
      "detail": "Key (id)=(11111111-1111-1111-a111-111111111111) already exists."
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Invalid KB API Credentials",
      "detail": "Kb api credentials are invalid"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /eholdings/kb-credentials/{id}

Get a specific KB credentials by id.

GET /eholdings/kb-credentials/{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}$)

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "KB Credentials Collection Item Schema",
  "description": "KB Credentials Collection Item Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentials",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of entry",
      "$ref": "../../raml-util/schemas/uuid.schema",
      "examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
    },
    "type": {
      "type": "string",
      "description": "Type of resource",
      "enum": ["kbCredentials"],
      "example": "kbCredentials"
    },
    "attributes": {
      "type": "object",
      "description": "KB credentials collection item attributes",
      "$ref": "kbCredentialsDataAttributes.json"
    },
    "meta": {
      "type": "object",
      "description": "Metadata about creation and changes to item",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "type",
    "attributes"
  ]
}

Example:

{
  "id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
  "type": "kbCredentials",
  "attributes": {
    "name": "University of Massachusetts",
    "apiKey": "XXXX",
    "url": "****************************************",
    "customerId": "ZZZZ"
  },
  "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"
  }
}

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Invalid id '99999999-9999-2-9999-999999999999'"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "KB credentials with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PATCH /eholdings/kb-credentials/{id}

Update KB credentials

PATCH /eholdings/kb-credentials/{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}$)
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": "KB Credentials PATCH Request Schema",
  "description": "KB Credentials PATCH Request Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentialsPatchRequest",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "Patch request data object",
      "$ref": "kbCredentialsPatchRequestData.json"
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "id": "99999999-9999-9999-9999-999999999999",
    "type": "kbCredentials",
    "attributes": {
      "name": "University of Massachusetts"
    }
  }
}

Response 204

No Content

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Duplicate Name",
      "detail": "KB credentials with name 'Credentials' already exists."
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 404

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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "KB credentials with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Invalid KB API Credentials",
      "detail": "Kb api credentials are invalid"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /eholdings/kb-credentials/{id}

Update KB credentials

PUT /eholdings/kb-credentials/{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}$)
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": "KB Credentials PUT Request Schema",
  "description": "KB Credentials PUT Request Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentialsPutRequest",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "KB Credentials object",
      "$ref": "kbCredentials.json"
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "id": "99999999-9999-9999-9999-999999999999",
    "type": "kbCredentials",
    "attributes": {
      "name": "University of Massachusetts",
      "apiKey": "XXXX",
      "url": "YYYY",
      "customerId": "ZZZZ"
    }
  }
}

Response 204

No Content

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Duplicate Name",
      "detail": "KB credentials with name '11111111-1111-1111-a111-111111111111' already exists."
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "KB credentials with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Invalid KB API Credentials",
      "detail": "Kb api credentials are invalid"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

DELETE /eholdings/kb-credentials/{id}

Delete KB Credentials

DELETE /eholdings/kb-credentials/{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}$)

Response 204

No Content

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Credentials have related records and cannot be deleted"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

Invalid token

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

/eholdings/user-kb-credential

Instance of a KB credentials by given assigned user

GET /eholdings/user-kb-credential

Retrieve KB credentials by given assigned user

GET /eholdings/user-kb-credential

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "KB Credentials Collection Item Schema",
  "description": "KB Credentials Collection Item Schema",
  "javaType": "org.folio.rest.jaxrs.model.KbCredentials",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of entry",
      "$ref": "../../raml-util/schemas/uuid.schema",
      "examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
    },
    "type": {
      "type": "string",
      "description": "Type of resource",
      "enum": ["kbCredentials"],
      "example": "kbCredentials"
    },
    "attributes": {
      "type": "object",
      "description": "KB credentials collection item attributes",
      "$ref": "kbCredentialsDataAttributes.json"
    },
    "meta": {
      "type": "object",
      "description": "Metadata about creation and changes to item",
      "$ref": "../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "type",
    "attributes"
  ]
}

Example:

{
  "id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
  "type": "kbCredentials",
  "attributes": {
    "name": "University of Massachusetts",
    "apiKey": "XXXX",
    "url": "****************************************",
    "customerId": "ZZZZ"
  },
  "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"
  }
}

Response 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",
        "$ref": "jsonapiErrorResponse.json"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$ref": "jsonapi.json"
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "Assigned user with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}