OAI-PMH API API documentation version v3
https://github.com/folio-org/mod-oai-pmh
Set API
API for managing sets and filtering conditions that is used as part of metadata harvesting protocol implementation
Sets
CRUD API for managing set items
Creates the set item
post /oai-pmh/sets
Creates the set item
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID",
"$ref": "../common/uuid.json"
},
"name": {
"description": "Corresponding snapshot id, which is the same as jobExecutionId",
"type": "string"
},
"description": {
"description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records",
"type": "string"
},
"setSpec": {
"description": "Generation from the last record with the same matchedId incremented by 1. Starts from 0.",
"type": "string"
},
"filteringConditions" : {
"description": "list of filtering conditions",
"ref": "filteringConditionCollection.json"
},
"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",
"$ref": "../common/uuid.json"
},
"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",
"$ref": "../common/uuid.json"
}
},
"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"
}
HTTP status code 201
Returns a newly created set item, with server-controlled fields like 'id' populated
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID",
"$ref": "../common/uuid.json"
},
"name": {
"description": "Corresponding snapshot id, which is the same as jobExecutionId",
"type": "string"
},
"description": {
"description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records",
"type": "string"
},
"setSpec": {
"description": "Generation from the last record with the same matchedId incremented by 1. Starts from 0.",
"type": "string"
},
"filteringConditions" : {
"description": "list of filtering conditions",
"ref": "filteringConditionCollection.json"
},
"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",
"$ref": "../common/uuid.json"
},
"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",
"$ref": "../common/uuid.json"
}
},
"required": [
"name",
"setSpec"
]
}
HTTP status code 400
Returns a newly created set item, with server-controlled fields like 'id' populated
Body
Media type: text/plain
Type: any
Example:
Set item with specified id already exists
Get, Delete or Update a specific set item
Update set item with given {setId}
Retrieve set item with given {setId}
Delete set item with given {setId}
put /oai-pmh/sets/{id}
Update set item with given {setId}
URI Parameters
- id: required(string)
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID",
"$ref": "../common/uuid.json"
},
"name": {
"description": "Corresponding snapshot id, which is the same as jobExecutionId",
"type": "string"
},
"description": {
"description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records",
"type": "string"
},
"setSpec": {
"description": "Generation from the last record with the same matchedId incremented by 1. Starts from 0.",
"type": "string"
},
"filteringConditions" : {
"description": "list of filtering conditions",
"ref": "filteringConditionCollection.json"
},
"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",
"$ref": "../common/uuid.json"
},
"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",
"$ref": "../common/uuid.json"
}
},
"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"
}
HTTP status code 204
Item successfully updated
HTTP status code 400
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.
Body
Media type: text/plain
Type: any
Example:
"unable to update set -- malformed JSON at 13:4"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"set not found"
HTTP status code 422
Validation errors
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$ref": "error.schema"
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
get /oai-pmh/sets/{id}
Retrieve set item with given {setId}
URI Parameters
- id: required(string)
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 200
Returns item with a given ID
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Set DTO Schema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"description": "UUID",
"$ref": "../common/uuid.json"
},
"name": {
"description": "Corresponding snapshot id, which is the same as jobExecutionId",
"type": "string"
},
"description": {
"description": "Represents relations with another matched records, necessary for saving the history of applying changes for inventory/holding/etc records",
"type": "string"
},
"setSpec": {
"description": "Generation from the last record with the same matchedId incremented by 1. Starts from 0.",
"type": "string"
},
"filteringConditions" : {
"description": "list of filtering conditions",
"ref": "filteringConditionCollection.json"
},
"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",
"$ref": "../common/uuid.json"
},
"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",
"$ref": "../common/uuid.json"
}
},
"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"
}
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"set not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
delete /oai-pmh/sets/{id}
Delete set item with given {setId}
URI Parameters
- id: required(string)
Query Parameters
- lang: (string - default: en - pattern: [a-zA-Z]{2})
Requested language. Optional. [lang=en]
HTTP status code 204
Item deleted successfully
HTTP status code 400
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.
Body
Media type: text/plain
Type: any
Example:
"unable to delete set -- constraint violation"
HTTP status code 404
Item with a given ID not found
Body
Media type: text/plain
Type: any
Example:
"set not found"
HTTP status code 500
Internal server error, e.g. due to misconfiguration
Body
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator