https://github.com/folio-org/mod-oai-pmh
API for managing sets and filtering conditions that is used as part of metadata harvesting protocol implementation
CRUD API for managing set items
Create a new set item.
POST /oai-pmh/sets
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.FolioSet",
"properties": {
"id": {
"description": "UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"name": {
"description": "set name",
"type": "string"
},
"description": {
"description": "set description",
"type": "string"
},
"setSpec": {
"description": "set 'set spec' value based on included filtering-conditions",
"type": "string"
},
"filteringConditions": {
"description": "list of filtering conditions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Filtering condition DTO Schema",
"additionalProperties": false,
"properties": {
"name": {
"description": "Filtering condition name",
"type": "string"
},
"value": {
"description": "Filtering condition value",
"type": "string"
},
"setSpec": {
"description": "Set of spec",
"type": "string"
}
},
"required": [
"name",
"value",
"setSpec"
]
},
"ref": "filteringConditionCollection.json"
},
"createdDate": {
"description": "Date and time when the set was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who set the record",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"updatedDate": {
"description": "Date and time when the set was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the set",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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": [
"name",
"setSpec"
]
}
Example:
{
"id" : "88dfac11-1caf-4470-9ad1-d533f6360bdd",
"name" : "example set",
"description" : "example description",
"setSpec" : "EXAMPLE:SET:SPEC",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created set item
Media type: application/json
Type: any
Example:
{
"id" : "88dfac11-1caf-4470-9ad1-d533f6360bdd",
"name" : "example set",
"description" : "example description",
"setSpec" : "EXAMPLE:SET:SPEC",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
}
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to add set -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create sets -- unauthorized
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Retrieve a list of set items.
GET /oai-pmh/sets
How to calculate the totalRecords property. "exact" for the correct number, "estimated" for an estimation, "auto" to automatically select "exact" or "estimated", "none" for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
none
Skip over a number of elements by specifying an offset value for the query
Example:
0
Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
10
Returns a list of set items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Filtering condition DTO Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"sets": {
"description": "list of folio sets",
"type": "array",
"id": "folioSetList",
"items": {
"javaType": "org.folio.rest.jaxrs.model.FolioSet",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"name": {
"description": "set name",
"type": "string"
},
"description": {
"description": "set description",
"type": "string"
},
"setSpec": {
"description": "set 'set spec' value based on included filtering-conditions",
"type": "string"
},
"filteringConditions": {
"description": "list of filtering conditions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Filtering condition DTO Schema",
"additionalProperties": false,
"properties": {
"name": {
"description": "Filtering condition name",
"type": "string"
},
"value": {
"description": "Filtering condition value",
"type": "string"
},
"setSpec": {
"description": "Set of spec",
"type": "string"
}
},
"required": [
"name",
"value",
"setSpec"
]
},
"ref": "filteringConditionCollection.json"
},
"createdDate": {
"description": "Date and time when the set was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who set the record",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"updatedDate": {
"description": "Date and time when the set was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the set",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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": [
"name",
"setSpec"
]
}
},
"totalRecords": {
"type": "integer",
"description": "Total number of records"
}
},
"required": [
"precedingSucceedingTitles",
"totalRecords"
]
}
Example:
{
"sets": [
{
"id" : "88dfac11-1caf-4470-9ad1-d533f6360bdd",
"name" : "example set",
"description" : "example description",
"setSpec" : "EXAMPLE:SET:SPEC",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
},
{
"id" : "40009db5-d330-46d0-ae0b-a0a08bdffb6d",
"name" : "example set 2",
"description" : "example description 2",
"setSpec" : "EXAMPLE:SET:SPEC:2",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
}
]
}
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
unable to list sets -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list sets -- unauthorized
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Update set item with given {setId}
PUT /oai-pmh/sets/{id}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.FolioSet",
"properties": {
"id": {
"description": "UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"name": {
"description": "set name",
"type": "string"
},
"description": {
"description": "set description",
"type": "string"
},
"setSpec": {
"description": "set 'set spec' value based on included filtering-conditions",
"type": "string"
},
"filteringConditions": {
"description": "list of filtering conditions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Filtering condition DTO Schema",
"additionalProperties": false,
"properties": {
"name": {
"description": "Filtering condition name",
"type": "string"
},
"value": {
"description": "Filtering condition value",
"type": "string"
},
"setSpec": {
"description": "Set of spec",
"type": "string"
}
},
"required": [
"name",
"value",
"setSpec"
]
},
"ref": "filteringConditionCollection.json"
},
"createdDate": {
"description": "Date and time when the set was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who set the record",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"updatedDate": {
"description": "Date and time when the set was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the set",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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": [
"name",
"setSpec"
]
}
Example:
{
"id" : "88dfac11-1caf-4470-9ad1-d533f6360bdd",
"name" : "example set",
"description" : "example description",
"setSpec" : "EXAMPLE:SET:SPEC",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
}
Item successfully updated
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to update set -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"set not found"
Optimistic locking version conflict
Media type: text/plain
Type: any
Example:
version conflict
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Retrieve set item with given {setId}
GET /oai-pmh/sets/{id}
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.FolioSet",
"properties": {
"id": {
"description": "UUID",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"name": {
"description": "set name",
"type": "string"
},
"description": {
"description": "set description",
"type": "string"
},
"setSpec": {
"description": "set 'set spec' value based on included filtering-conditions",
"type": "string"
},
"filteringConditions": {
"description": "list of filtering conditions",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Filtering condition DTO Schema",
"additionalProperties": false,
"properties": {
"name": {
"description": "Filtering condition name",
"type": "string"
},
"value": {
"description": "Filtering condition value",
"type": "string"
},
"setSpec": {
"description": "Set of spec",
"type": "string"
}
},
"required": [
"name",
"value",
"setSpec"
]
},
"ref": "filteringConditionCollection.json"
},
"createdDate": {
"description": "Date and time when the set was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who set the record",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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}$"
},
"updatedDate": {
"description": "Date and time when the set was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the set",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string",
"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": [
"name",
"setSpec"
]
}
Example:
{
"id" : "88dfac11-1caf-4470-9ad1-d533f6360bdd",
"name" : "example set",
"description" : "example description",
"setSpec" : "EXAMPLE:SET:SPEC",
"createdDate" : "2020-07-27T11:19:58.293+0000",
"createdByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb",
"updatedDate" : "2020-08-02T12:23:57.298+0000",
"updatedByUserId" : "ba332b37-1e74-4e95-b61f-a220401ef0bb"
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"set not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Delete set item with given {setId}
DELETE /oai-pmh/sets/{id}
Item deleted successfully
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to delete set -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"set not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator