Notes API (v1)

https://github.com/folio-org/mod-notes

Table of contents

mod-notes API

This documents the API calls that can be made to query and manage notes about all kind of objects

Notes

Notes collection

POST /notes

Create a new note item.

POST /notes
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#",
  "type": "object",
  "description": "Notes about all kind of objects",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique generated identifier for the note",
      "example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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}$"
    },
    "typeId": {
      "type": "string",
      "description": "Type id of note",
      "example": "13d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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 note (configured in settings)",
      "example": "Access issues",
      "readonly": true
    },
    "domain": {
      "type": "string",
      "description": "Domain associated with this note",
      "example": "eholdings"
    },
    "title": {
      "type": "string",
      "maxLength": 255,
      "description": "Note title",
      "example": "BU Campus only issues"
    },
    "content": {
      "type": "string",
      "description": "Content of the note",
      "example": "There are access issues at BU campus"
    },
    "status": {
      "type": "string",
      "description": "Status of note - applies when searching by link.id and status",
      "enum": [
        "ASSIGNED",
        "UNASSIGNED"
      ],
      "example": "ASSIGNED",
      "readonly": true
    },
    "creator": {
      "type": "object",
      "description": "User display info for creator of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "updater": {
      "type": "object",
      "description": "User display info for updater of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    },
    "links": {
      "description": "Collection of links to associated objects",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Link to object associated with a note",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of object linked to note",
            "example": "1234-5678"
          },
          "type": {
            "type": "string",
            "description": "Type of object linked to note",
            "example": "package"
          }
        },
        "required": [
          "id",
          "type"
        ]
      }
    }
  },
  "required": [
    "typeId",
    "title",
    "domain",
    "links"
  ]
}

Example:

{
  "id": "62d00c36-a94f-434d-9cd2-c7ea159303da",
  "type": "High Priority",
  "title" : "BU Campus Access Issues",
  "domain": "eholdings",
  "content": "There have been access issues at the BU campus since the weekend",
  "creator": {
    "lastName" : "Smith",
    "firstName": "Robin",
    "middleName": "H"
  },
  "updater": {
    "lastName" : "Jones",
    "firstName": "David",
    "middleName": "W"
  },
  "status" : "ASSIGNED",
  "metadata": {
    "createdDate" : "2019-03-28T01:54:17.855+0000",
    "createdByUserId" :"86c9f455-a685-45d0-9d01-5943a1ba7e5b",
    "createdByUsername" : "smithr",
    "updatedDate" : "2019-03-28T03:00:00.900+0000",
    "updatedByUserId" : "bdc2b6d4-5ceb-4a12-ab46-249b9a68473e",
    "updatedByUserName" : "jonesd"
  },
  "links": [
    {
      "id" : "583-2356521",
      "type": "package"
    },
    {
      "id" : "583-2356521-758038",
      "type": "resource"
    }
  ]
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created note item

Body

Media type: application/json

Type: any

Example:

{
  "id": "62d00c36-a94f-434d-9cd2-c7ea159303da",
  "type": "High Priority",
  "title" : "BU Campus Access Issues",
  "domain": "eholdings",
  "content": "There have been access issues at the BU campus since the weekend",
  "creator": {
    "lastName" : "Smith",
    "firstName": "Robin",
    "middleName": "H"
  },
  "updater": {
    "lastName" : "Jones",
    "firstName": "David",
    "middleName": "W"
  },
  "status" : "ASSIGNED",
  "metadata": {
    "createdDate" : "2019-03-28T01:54:17.855+0000",
    "createdByUserId" :"86c9f455-a685-45d0-9d01-5943a1ba7e5b",
    "createdByUsername" : "smithr",
    "updatedDate" : "2019-03-28T03:00:00.900+0000",
    "updatedByUserId" : "bdc2b6d4-5ceb-4a12-ab46-249b9a68473e",
    "updatedByUserName" : "jonesd"
  },
  "links": [
    {
      "id" : "583-2356521",
      "type": "package"
    },
    {
      "id" : "583-2356521-758038",
      "type": "resource"
    }
  ]
}

Response 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 add note -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create notes -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/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#",
        "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": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /notes

Retrieve a list of note items.

GET /notes
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example link.id = 1234

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    link.id=1234
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of note items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of notes",
  "properties": {
    "notes": {
      "description": "Collection of notes",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Notes about all kind of objects",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique generated identifier for the note",
            "example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
            "$schema": "http://json-schema.org/draft-04/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}$"
          },
          "typeId": {
            "type": "string",
            "description": "Type id of note",
            "example": "13d00c36-a94f-434d-9cd2-c7ea159303da",
            "$schema": "http://json-schema.org/draft-04/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 note (configured in settings)",
            "example": "Access issues",
            "readonly": true
          },
          "domain": {
            "type": "string",
            "description": "Domain associated with this note",
            "example": "eholdings"
          },
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "Note title",
            "example": "BU Campus only issues"
          },
          "content": {
            "type": "string",
            "description": "Content of the note",
            "example": "There are access issues at BU campus"
          },
          "status": {
            "type": "string",
            "description": "Status of note - applies when searching by link.id and status",
            "enum": [
              "ASSIGNED",
              "UNASSIGNED"
            ],
            "example": "ASSIGNED",
            "readonly": true
          },
          "creator": {
            "type": "object",
            "description": "User display info for creator of the note",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
            "additionalProperties": false,
            "properties": {
              "lastName": {
                "type": "string",
                "description": "Last name of the user",
                "example": "Doe",
                "readonly": true
              },
              "firstName": {
                "type": "string",
                "description": "First name of the user",
                "example": "John",
                "readonly": true
              },
              "middleName": {
                "type": "string",
                "description": "Middle name or initial of the user",
                "example": "X.",
                "readonly": true
              }
            }
          },
          "updater": {
            "type": "object",
            "description": "User display info for updater of the note",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
            "additionalProperties": false,
            "properties": {
              "lastName": {
                "type": "string",
                "description": "Last name of the user",
                "example": "Doe",
                "readonly": true
              },
              "firstName": {
                "type": "string",
                "description": "First name of the user",
                "example": "John",
                "readonly": true
              },
              "middleName": {
                "type": "string",
                "description": "Middle name or initial of the user",
                "example": "X.",
                "readonly": true
              }
            }
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "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 (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "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 (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          },
          "links": {
            "description": "Collection of links to associated objects",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "Link to object associated with a note",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Id of object linked to note",
                  "example": "1234-5678"
                },
                "type": {
                  "type": "string",
                  "description": "Type of object linked to note",
                  "example": "package"
                }
              },
              "required": [
                "id",
                "type"
              ]
            }
          }
        },
        "required": [
          "typeId",
          "title",
          "domain",
          "links"
        ]
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "notes",
    "totalRecords"
  ]
}

Example:

{
  "notes": [
     {
       "id": "62d00c36-a94f-434d-9cd2-c7ea159303da",
       "type": "High Priority",
       "title" : "BU Campus Access Issues",
       "domain": "eholdings",
       "creator": {
         "lastName" : "Smith",
         "firstName": "Robin",
         "middleName": "H"
       },
       "updater": {
         "lastName" : "Jones",
         "firstName": "David",
         "middleName": "W"
       },
       "status" : "ASSIGNED",
       "metadata": {
         "createdDate" : "2019-03-28T01:54:17.855+0000",
         "createdByUserId" :"86c9f455-a685-45d0-9d01-5943a1ba7e5b",
         "createdByUsername" : "smithr",
         "updatedDate" : "2019-03-28T03:00:00.900+0000",
         "updatedByUserId" : "bdc2b6d4-5ceb-4a12-ab46-249b9a68473e",
         "updatedByUserName" : "jonesd"
       },
       "links": [
         {
           "id" : "583-2356521",
           "type": "package"
         },
         {
           "id" : "583-2356521-758038",
           "type": "resource"
         }
       ]
     }
  ],
  "totalRecords": 1
}

Response 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 list notes -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list notes -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/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#",
        "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": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

GET /notes/{id}

Retrieve note item with given {noteId}

GET /notes/{id}
URI Parameters
  • id: required (string - pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Notes about all kind of objects",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique generated identifier for the note",
      "example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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}$"
    },
    "typeId": {
      "type": "string",
      "description": "Type id of note",
      "example": "13d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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 note (configured in settings)",
      "example": "Access issues",
      "readonly": true
    },
    "domain": {
      "type": "string",
      "description": "Domain associated with this note",
      "example": "eholdings"
    },
    "title": {
      "type": "string",
      "maxLength": 255,
      "description": "Note title",
      "example": "BU Campus only issues"
    },
    "content": {
      "type": "string",
      "description": "Content of the note",
      "example": "There are access issues at BU campus"
    },
    "status": {
      "type": "string",
      "description": "Status of note - applies when searching by link.id and status",
      "enum": [
        "ASSIGNED",
        "UNASSIGNED"
      ],
      "example": "ASSIGNED",
      "readonly": true
    },
    "creator": {
      "type": "object",
      "description": "User display info for creator of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "updater": {
      "type": "object",
      "description": "User display info for updater of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    },
    "links": {
      "description": "Collection of links to associated objects",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Link to object associated with a note",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of object linked to note",
            "example": "1234-5678"
          },
          "type": {
            "type": "string",
            "description": "Type of object linked to note",
            "example": "package"
          }
        },
        "required": [
          "id",
          "type"
        ]
      }
    }
  },
  "required": [
    "typeId",
    "title",
    "domain",
    "links"
  ]
}

Example:

{
  "id": "62d00c36-a94f-434d-9cd2-c7ea159303da",
  "type": "High Priority",
  "title" : "BU Campus Access Issues",
  "domain": "eholdings",
  "content": "There have been access issues at the BU campus since the weekend",
  "creator": {
    "lastName" : "Smith",
    "firstName": "Robin",
    "middleName": "H"
  },
  "updater": {
    "lastName" : "Jones",
    "firstName": "David",
    "middleName": "W"
  },
  "status" : "ASSIGNED",
  "metadata": {
    "createdDate" : "2019-03-28T01:54:17.855+0000",
    "createdByUserId" :"86c9f455-a685-45d0-9d01-5943a1ba7e5b",
    "createdByUsername" : "smithr",
    "updatedDate" : "2019-03-28T03:00:00.900+0000",
    "updatedByUserId" : "bdc2b6d4-5ceb-4a12-ab46-249b9a68473e",
    "updatedByUserName" : "jonesd"
  },
  "links": [
    {
      "id" : "583-2356521",
      "type": "package"
    },
    {
      "id" : "583-2356521-758038",
      "type": "resource"
    }
  ]
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"note not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/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#",
        "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": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

PUT /notes/{id}

Update note item with given {noteId}

PUT /notes/{id}
URI Parameters
  • id: required (string - pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$)
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#",
  "type": "object",
  "description": "Notes about all kind of objects",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique generated identifier for the note",
      "example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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}$"
    },
    "typeId": {
      "type": "string",
      "description": "Type id of note",
      "example": "13d00c36-a94f-434d-9cd2-c7ea159303da",
      "$schema": "http://json-schema.org/draft-04/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 note (configured in settings)",
      "example": "Access issues",
      "readonly": true
    },
    "domain": {
      "type": "string",
      "description": "Domain associated with this note",
      "example": "eholdings"
    },
    "title": {
      "type": "string",
      "maxLength": 255,
      "description": "Note title",
      "example": "BU Campus only issues"
    },
    "content": {
      "type": "string",
      "description": "Content of the note",
      "example": "There are access issues at BU campus"
    },
    "status": {
      "type": "string",
      "description": "Status of note - applies when searching by link.id and status",
      "enum": [
        "ASSIGNED",
        "UNASSIGNED"
      ],
      "example": "ASSIGNED",
      "readonly": true
    },
    "creator": {
      "type": "object",
      "description": "User display info for creator of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "updater": {
      "type": "object",
      "description": "User display info for updater of the note",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "javaType": "org.folio.rest.jaxrs.model.UserDisplayInfo",
      "additionalProperties": false,
      "properties": {
        "lastName": {
          "type": "string",
          "description": "Last name of the user",
          "example": "Doe",
          "readonly": true
        },
        "firstName": {
          "type": "string",
          "description": "First name of the user",
          "example": "John",
          "readonly": true
        },
        "middleName": {
          "type": "string",
          "description": "Middle name or initial of the user",
          "example": "X.",
          "readonly": true
        }
      }
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "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 (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    },
    "links": {
      "description": "Collection of links to associated objects",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "Link to object associated with a note",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of object linked to note",
            "example": "1234-5678"
          },
          "type": {
            "type": "string",
            "description": "Type of object linked to note",
            "example": "package"
          }
        },
        "required": [
          "id",
          "type"
        ]
      }
    }
  },
  "required": [
    "typeId",
    "title",
    "domain",
    "links"
  ]
}

Example:

{
  "id": "62d00c36-a94f-434d-9cd2-c7ea159303da",
  "type": "High Priority",
  "title" : "BU Campus Access Issues",
  "domain": "eholdings",
  "content": "There have been access issues at the BU campus since the weekend",
  "creator": {
    "lastName" : "Smith",
    "firstName": "Robin",
    "middleName": "H"
  },
  "updater": {
    "lastName" : "Jones",
    "firstName": "David",
    "middleName": "W"
  },
  "status" : "ASSIGNED",
  "metadata": {
    "createdDate" : "2019-03-28T01:54:17.855+0000",
    "createdByUserId" :"86c9f455-a685-45d0-9d01-5943a1ba7e5b",
    "createdByUsername" : "smithr",
    "updatedDate" : "2019-03-28T03:00:00.900+0000",
    "updatedByUserId" : "bdc2b6d4-5ceb-4a12-ab46-249b9a68473e",
    "updatedByUserName" : "jonesd"
  },
  "links": [
    {
      "id" : "583-2356521",
      "type": "package"
    },
    {
      "id" : "583-2356521-758038",
      "type": "resource"
    }
  ]
}

Response 204

Item successfully updated

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

"unable to update note -- malformed JSON at 13:4"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"note not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/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#",
        "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": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /notes/{id}

Delete note item with given {noteId}

DELETE /notes/{id}
URI Parameters
  • id: required (string - pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$)
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

"unable to delete note -- constraint violation"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"note not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/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#",
        "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": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "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"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator