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.

Users assigned to KB Credentials

GET /eholdings/kb-credentials/{id}/users

Retrieve users information assigned to a specific KB credentials.

GET /eholdings/kb-credentials/{id}/users
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": "Assigned Users Collection Schema",
  "description": "Assigned Users Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserCollection",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Collection of assigned users to KB Credentials",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Assigned Users Collection Item Schema",
        "description": "Assigned Users Collection Item Schema",
        "javaType": "org.folio.rest.jaxrs.model.AssignedUser",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "The UUID of a user",
            "examples": "1f8f660e-7dc9-4f6f-828f-96284c68a25",
            "$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": [
              "assignedUsers"
            ],
            "example": "assignedUsers"
          },
          "attributes": {
            "type": "object",
            "description": "Assigned users collection item attributes",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Assigned Users Collection Item Data Attributes Schema",
            "javaType": "org.folio.rest.jaxrs.model.AssignedUserDataAttributes",
            "additionalProperties": false,
            "properties": {
              "credentialsId": {
                "type": "string",
                "description": "UUID of KB Credentials tied to",
                "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}$"
              },
              "userName": {
                "type": "string",
                "description": "A unique name belonging to a user",
                "examples": "john_doe"
              },
              "firstName": {
                "type": "string",
                "description": "The first name of a user",
                "examples": "John"
              },
              "middleName": {
                "type": "string",
                "description": "The middle name of a user (if any)",
                "examples": "William"
              },
              "lastName": {
                "type": "string",
                "description": "The surname of a user",
                "examples": "Doe"
              },
              "patronGroup": {
                "type": "string",
                "description": "The patron group name",
                "examples": "Staff"
              }
            },
            "required": [
              "credentialsId",
              "userName",
              "lastName",
              "patronGroup"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "attributes"
        ]
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata containing total size of collection",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata total results Schema",
      "javaType": "org.folio.rest.jaxrs.model.MetaTotalResults",
      "additionalProperties": false,
      "properties": {
        "totalResults": {
          "type": "integer",
          "description": "Total number of results",
          "example": 2
        }
      },
      "required": [
        "totalResults"
      ]
    },
    "jsonapi": {
      "type": "object",
      "description": "Version of JSON API",
      "$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"
      ]
    }
  },
  "required": [
    "data",
    "meta",
    "jsonapi"
  ]
}

Example:

{
  "data": [{
    "id": "1f8f660e-7dc9-4f6f-828f-96284c68a25",
    "type": "assignedUsers",
    "attributes": {
      "credentialsId": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
      "firstName": "John",
      "middleName": "William",
      "lastName": "Doe",
      "patronGroup": "Staff",
      "userName": "john_doe"
    }
  }],
  "meta": {
    "totalResults": 1
  },
  "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",
        "$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 input syntax for type uuid: \"invalid-id\""
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

POST /eholdings/kb-credentials/{id}/users

Assign user to a specific KB credentials.

POST /eholdings/kb-credentials/{id}/users
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": "POST Request To Assigned Users Id Collection Schema",
  "description": "POST Request To Assigned Users Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserPostRequest",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "Assigned user Id",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Assigned Users Id Collection Item Schema",
      "javaType": "org.folio.rest.jaxrs.model.AssignedUserId",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "The UUID of a user",
          "examples": "1f8f660e-7dc9-4f6f-828f-96284c68a25",
          "$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}$"
        },
        "credentialsId": {
          "type": "string",
          "description": "UUID of KB Credentials tied to",
          "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}$"
        }
      },
      "required": [
        "id"
      ]
    }
  },
  "required": [
    "data"
  ]
}

Example:

{
  "data": {
    "id": "99999999-9999-9999-9999-999999999999",
    "credentialsId": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
  }
}

Response 201

Created

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Assigned Users Id Collection Item Schema",
  "description": "Assigned Users Collection Item Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserId",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of a user",
      "examples": "1f8f660e-7dc9-4f6f-828f-96284c68a25",
      "$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}$"
    },
    "credentialsId": {
      "type": "string",
      "description": "UUID of KB Credentials tied to",
      "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}$"
    }
  },
  "required": [
    "id"
  ]
}

Example:

{
  "id": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
  "credentialsId": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
}

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",
        "$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": "The user is already assigned to another credentials"
    }
  ],
  "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",
        "$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": "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",
        "$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 username",
      "detail": "username must be not null"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

DELETE /eholdings/kb-credentials/{id}/users/{userId}

Remove association between user and KB Credentials

DELETE /eholdings/kb-credentials/{id}/users/{userId}
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}$)
  • userId: 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",
        "$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 input syntax for type uuid: \"invalid-id\"",
      "detail": "22P02"
    }
  ],
  "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",
        "$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": "Assigned User with id '99999999-9999-9999-9999-999999999999' does not exist"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}