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.

Resources

POST /eholdings/resources

Create a relation between an existing custom package and an existing custom/managed title.

POST /eholdings/resources
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": "Resource POST Request Schema",
  "description": "Resource Post Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.ResourcePostRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of resource post request",
      "type": "object",
      "$ref": "resourcePostData.json"
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "type": "resources",
    "attributes": {
      "packageId": "123355-2845510",
      "titleId": "17059786",
      "url": "https://hello.io"
    }
  }
}

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType" : "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}

Example:

{
  "data": {
    "id": "123355-2845510-17059786",
    "type": "resources",
    "attributes": {
      "description": null,
      "edition": null,
      "isPeerReviewed": false,
      "isTitleCustom": true,
      "publisherName": null,
      "titleId": 17059786,
      "contributors": [],
      "identifiers": [
        {
          "id": "978-1-4488-6317-4",
          "type": "ISBN",
          "subtype": "Print"
        },
        {
          "id": "978-1-4488-6522-2",
          "type": "ISBN",
          "subtype": "Online"
        }
      ],
      "name": "SD custom title",
      "publicationType": "Book",
      "subjects": [],
      "coverageStatement": null,
      "customEmbargoPeriod": {
        "embargoUnit": null,
        "embargoValue": 0
      },
      "isPackageCustom": true,
      "isSelected": true,
      "isTokenNeeded": false,
      "locationId": 0,
      "managedEmbargoPeriod": {
        "embargoUnit": null,
        "embargoValue": 0
      },
      "packageId": "123355-2845510",
      "packageName": "Testing2",
      "url": null,
      "providerId": 123355,
      "providerName": "API DEV CORPORATE CUSTOMER",
      "visibilityData": {
        "isHidden": false,
        "reason": ""
      },
      "managedCoverages": [],
      "customCoverages": [],
      "proxy": {
        "id": "<n>",
        "inherited": true
      }
    },
    "relationships": {
      "provider": {
        "meta": {
          "included": false
        }
      },
      "title": {
        "meta": {
          "included": false
        }
      },
      "package": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "jsonapi": {
    "version": "1.0"
  }
}

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": "Package and provider id are required"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

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": "Title 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 PackageId",
    "detail": "Packageid Cannot associate Title with a managed Package",
    "source": {}
  }],
  "jsonapi": {
    "version": "1.0"
  }
}

GET /eholdings/resources/{resourceId}

Retrieve a specific resource given resourceId. Note that a resource is a managed/custom title associated with a managed/custom package. resourceId is providerId-packageId-titleId

GET /eholdings/resources/{resourceId}
URI Parameters
  • resourceId: required (string)

    Identifier of the resource formed from Provider Id, Package Id, Title Id (see example)

    Example:

    22-1887786-1440285
Query Parameters
  • include: (string)

    Include provider, package or title in response Possible values are

    • provider
    • package
    • title

    Example:

    provider

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType" : "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}

Example:

{
  "data": {
    "id": "22-1887786-1440285",
    "type": "resources",
    "attributes": {
      "description": null,
      "edition": null,
      "isPeerReviewed": false,
      "isTitleCustom": false,
      "publisherName": "Elsevier",
      "titleId": 1440285,
      "contributors": [
        {
          "type": "Author",
          "contributor": "Havard, Margaret"
        },
        {
          "type": "Author",
          "contributor": "Tiziani, Adriana."
        }
      ],
      "identifiers": [
        {
          "id": "1440285",
          "type": "BHM",
          "subtype": "Empty"
        },
        {
          "id": "475765",
          "type": "EPBookID",
          "subtype": "Empty"
        },
        {
          "id": "978-0-7295-3913-5",
          "type": "ISBN",
          "subtype": "Print"
        },
        {
          "id": "978-0-7295-7913-1",
          "type": "ISBN",
          "subtype": "Online"
        }
      ],
      "name": "Havard's Nursing Guide to Drugs (Nursing Guide to Drugs)",
      "publicationType": "Book",
      "subjects": [
        {
          "type": "BISAC",
          "subject": "MEDICAL / Nursing / Pharmacology"
        }
      ],
      "coverageStatement": "Only 2000s issues available.",
      "customEmbargoPeriod": {
        "embargoUnit": "Days",
        "embargoValue": 7
      },
      "isPackageCustom": false,
      "isSelected": true,
      "isTokenNeeded": true,
      "locationId": 17545807,
      "managedEmbargoPeriod": {
        "embargoUnit": null,
        "embargoValue": 0
      },
      "packageId": "22-1887786",
      "packageName": "ProQuest Ebook Central",
      "url": "https://ebookcentral.proquest.com/lib/[[SiteID]]/detail.action?docID=1722033",
      "providerId": 22,
      "providerName": "Proquest Info & Learning Co",
      "visibilityData": {
        "isHidden": true,
        "reason": ""
      },
      "managedCoverages": [
        {
          "beginCoverage": "2010-01-01",
          "endCoverage": "2010-12-31"
        }
      ],
      "customCoverages": [
        {
          "beginCoverage": "2003-01-01",
          "endCoverage": "2004-01-01"
        }
      ],
      "proxy": {
        "id": "EZProxy",
        "inherited": false
      }
    },
    "relationships": {
      "provider": {
        "data": {
          "type": "providers",
          "id": "22"
        }
      },
      "title": {
        "meta": {
          "included": false
        }
      },
      "package": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "included": [
    {
      "id": "22",
      "type": "providers",
      "attributes": {
        "name": "Proquest Info & Learning Co",
        "packagesTotal": 840,
        "packagesSelected": 30,
        "providerToken": null,
        "supportsCustomPackages": false,
        "proxy": {
          "id": "EZProxy",
          "inherited": true
        }
      },
      "relationships": {
        "packages": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "1440285",
      "type": "titles",
      "attributes": {
        "name": "Havard's Nursing Guide to Drugs (Nursing Guide to Drugs)",
        "publisherName": "Elsevier",
        "isTitleCustom": false,
        "subjects": [
          {
            "type": "BISAC",
            "subject": "MEDICAL / Nursing / Pharmacology"
          }
        ],
        "identifiers": [
          {
            "id": "978-0-7295-3913-5",
            "type": "ISBN",
            "subtype": "Print"
          },
          {
            "id": "978-0-7295-7913-1",
            "type": "ISBN",
            "subtype": "Online"
          }
        ],
        "publicationType": "Book",
        "edition": null,
        "description": null,
        "isPeerReviewed": false,
        "contributors": [
          {
            "type": "author",
            "contributor": "Havard, Margaret"
          },
          {
            "type": "author",
            "contributor": "Tiziani, Adriana."
          }
        ]
      },
      "relationships": {
        "resources": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "22-1887786",
      "type": "packages",
      "attributes": {
        "contentType": "E-Book",
        "customCoverage": {
          "beginCoverage": "",
          "endCoverage": ""
        },
        "isCustom": false,
        "isSelected": true,
        "name": "ProQuest Ebook Central",
        "packageId": 1887786,
        "packageType": "Variable",
        "providerId": 22,
        "providerName": "Proquest Info & Learning Co",
        "selectedCount": 1305491,
        "titleCount": 1305491,
        "visibilityData": {
          "isHidden": false,
          "reason": ""
        },
        "allowKbToAddTitles": true,
        "packageToken": {
          "factName": "[[SiteID]]",
          "helpText": "The ID may contain a combination of alphanumeric characters, varying in length.",
          "value": null,
          "prompt": "/lib/ "
        },
        "proxy": {
          "id": "EZProxy",
          "inherited": true
        }
      },
      "relationships": {
        "resources": {
          "meta": {
            "included": false
          }
        },
        "provider": {
          "meta": {
            "included": false
          }
        }
      }
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

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 package_id",
      "detail": "Package can't be blank",
      "source": {}
    },
    {
      "title": "Invalid package_id",
      "detail": "Package :Invalid package id",
      "source": {}
    },
    {
      "title": "Invalid title_id",
      "detail": "Title can't be blank",
      "source": {}
    },
    {
      "title": "Invalid title_id",
      "detail": "Title :Invalid title id",
      "source": {}
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

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": "Title not found"
  }],
  "jsonapi": {
    "version": "1.0"
  }
}

PUT /eholdings/resources/{resourceId}

Update a managed or custom resource using resourceId Note that resourceId is providerId-packageId-titleId

PUT /eholdings/resources/{resourceId}
URI Parameters
  • resourceId: required (string)

    Identifier of the resource formed from Provider Id, Package Id, Title Id (see example)

    Example:

    22-1887786-1440285
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": "Resource PUT Request Schema",
  "description": "Resource Put Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.ResourcePutRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of resource put request",
      "type": "object",
      "$ref": "resourcePutData.json"
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "type": "resources",
    "attributes": {
     "name": "Updated Custom Title Name",
      "isPeerReviewed": true,
      "publicationType": "Newspaper",
      "publisherName": "Updated Publisher",
      "edition": "5",
      "description": "Updated Description",
      "url": "https://hello.io",
      "contributors": [
        {
        "type":"Author",
        "contributor":"smith, john"
        },
        {
        "type":"Illustrator",
        "contributor":"smith, ralph"
        }
      ],
      "identifiers": [
        {
        "id":"11-2222-3333",
        "type":"ISSN",
        "subtype":"Online"
        }
      ],
      "isSelected": true,
      "visibilityData": {
        "isHidden" : false
      },
      "customEmbargoPeriod": {
        "embargoUnit" : "Months",
        "embargoValue" : 5
      },
      "customCoverages" : [
      {
        "beginCoverage" : "2001-01-01",
        "endCoverage" : "2004-02-01"
      }
      ],
      "coverageStatement": "Updated Coverage Statement",
      "proxy" : {
        "id" : "<n>"
      }
    }
  }
}

Response 200

OK

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType" : "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}

Example:

{
  "data": {
    "id": "123355-2845510-17059786",
    "type": "resources",
    "attributes": {
      "description": null,
      "edition": null,
      "isPeerReviewed": false,
      "isTitleCustom": true,
      "publisherName": null,
      "titleId": 17059786,
      "contributors": [],
      "identifiers": [],
      "name": "SD custom title",
      "publicationType": "Book",
      "subjects": [],
      "coverageStatement": "hello",
      "customEmbargoPeriod": {
        "embargoUnit": "Weeks",
        "embargoValue": 4
      },
      "isPackageCustom": true,
      "isSelected": true,
      "isTokenNeeded": false,
      "locationId": 39248032,
      "managedEmbargoPeriod": {
        "embargoUnit": null,
        "embargoValue": 0
      },
      "packageId": "123355-2845510",
      "packageName": "\"Testing2\"",
      "url": "https://hello.io",
      "providerId": 123355,
      "providerName": "API DEV CORPORATE CUSTOMER",
      "visibilityData": {
        "isHidden": true,
        "reason": ""
      },
      "managedCoverages": [],
      "customCoverages": [{
          "beginCoverage": "2018-06-05",
          "endCoverage": "2018-06-07"
        },
        {
          "beginCoverage": "2018-06-08",
          "endCoverage": "2018-06-10"
        }
      ],
      "proxy": {
        "id": "<n>",
        "inherited": true
      }
    },
    "relationships": {
      "provider": {
        "meta": {
          "included": false
        }
      },
      "title": {
        "meta": {
          "included": false
        }
      },
      "package": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "jsonapi": {
    "version": "1.0"
  }
}

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": "CoverageList cannot contain overlapping dates."
  }],
  "jsonapi": {
    "version": "1.0"
  }
}

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": "Title 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 beginCoverage",
      "detail": "Begincoverage must be blank",
      "source": {}
    },
    {
      "title": "Invalid endCoverage",
      "detail": "Endcoverage must be blank",
      "source": {}
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

DELETE /eholdings/resources/{resourceId}

Delete the association between a custom/managed title and a custom package using resourceId. Note that resourceId is providerId-packageId-titleId If the title is custom and is not associated with any other package, then the title will be deleted from the knowledge base.

DELETE /eholdings/resources/{resourceId}
URI Parameters
  • resourceId: required (string)

    Identifier of the resource formed from Provider Id, Package Id, Title Id (see example)

    Example:

    22-1887786-1440285

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": "Invalid resource",
    "detail": "Resource cannot be deleted",
    "source": {}
  }],
  "jsonapi": {
    "version": "1.0"
  }
}

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": "Title not found"
  }],
  "jsonapi": {
    "version": "1.0"
  }
}