Record Set Contents

Preprocess Record Set Contents

PUT /api/.../recordsets/{recordsetid}/records?isPreprocessing=true&isBarcodeList=true&objectTypeID=0&templateID=0

Before adding new records to an existing record set, preprocess the new records to determine the following based on the record set Id and object type:

  • Record is valid (exists in the database)
  • Record is not a duplicate (already exists in the record set)

Return view data if the record is valid and does not already exist in the record set. ViewData will be based on the record set's object type.

The list of IDs/barcodes contained within the request body must be unique.

Request Information

Parameters
Name Type Required Description
recordsetid Integer Yes The id of the record set.
isPreprocessing Boolean Yes Enable preprocessing only. Set to false to update the record set.
isBarcodeList Boolean No Defaults to true. Supplied list is barcode. When set to false, list must be record Ids.
objectTypeID Integer No Defaults to 0. Valid values are 0 (API will determine objectTypeID), 1 (Auth), 2 (Bib), 3 (Item), 27 (Patron) and 107 (Weeding).
templateID Integer No Defaults to 0. New weeding record sets require a valid template ID for preprocessing.
Example Body containing list of record Ids
application/json, text/json
[
  '1',
  '4',
  '358255',
  '5000',
  '6000'
]

Response Information

Example Authority Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 1,
    "SuppliedRecordID": 1,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 1,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 1,
      "Heading": "Pember, Ann, 1946-",
      "ControlNumber": 1,
      "LinkedBibCount": 1,
      "LinkedSeeAlsoCount": 0,
      "IsName": true,
      "IsSubject": true,
      "IsSeries": false,
      "RecordStatusName": "Final               "
    }
  },
  {
    "ObjectTypeID": 1,
    "SuppliedRecordID": 4,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  }
]
Example Bibliographic Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 2,
    "SuppliedRecordID": 1,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  },
  {
    "ObjectTypeID": 2,
    "SuppliedRecordID": 4,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 4,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 4,
      "Title": "New trail blazers of technology",
      "Author": "Manchester, Harland, 1898-",
      "FormatDescription": "Book",
      "LinkedItemCount": 3,
      "LinkedHoldCount": 0,
      "PublicationDate": "1976",
      "CallNumber": "j 925 M",
      "ControlNumber": 4,
      "RecordStatusName": "Final               ",
      "NonFilingTuple": null,
      "SortTitle": "NEW TRAIL BLAZERS OF TECHNOLOGY"
    }
  }
]
Example Item Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 3,
    "SuppliedRecordID": 1,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  },
  {
    "ObjectTypeID": 3,
    "SuppliedRecordID": 4,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 4,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 4,
      "Title": "The Statue of Liberty, America's proud lady",
      "AssignedBranch": "Southern Adirondack Library System",
      "Collection": "Children's Nonfiction (JNF)",
      "MaterialType": "New / Popular Book",
      "ShelfLocation": null,
      "CallNumber": "J 974.71 H",
      "Volume": null,
      "Status": "Transferred",
      "Barcode": "0000100000512",
      "LastActivityDate": "2015-09-23T15:35:26.23-04:00",
      "RecordStatus": "Final",
      "NonFilingTuple": "0004",
      "SortTitle": "STATUE OF LIBERTY AMERICAS PROUD LADY"
    }
  }
]
Example Patron Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 27,
    "SuppliedRecordID": 0,
    "SuppliedBarcode": "21756003332061",
    "DatabaseRecordID": 358297,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 358297,
      "Barcode": "21756003332061",
      "PatronName": "Young, Kevin ",
      "Street": "89 Main Street ",
      "City": "JAMESVILLE",
      "State": "NY",
      "Zip": "13078-1234",
      "Library": "Amsterdam Free Library",
      "RecordStatusID": 1
    }
  },
  {
    "ObjectTypeID": 27,
    "SuppliedRecordID": 0,
    "SuppliedBarcode": "358255",
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  }
]
Example Weeding Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 107,
    "SuppliedRecordID": 1,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  },
  {
    "ObjectTypeID": 107,
    "SuppliedRecordID": 4,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 4,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 4,
      "Title": "The Statue of Liberty, America's proud lady",
      "AssignedBranch": "Southern Adirondack Library System",
      "Collection": "Children's Nonfiction (JNF)",
      "MaterialType": "New / Popular Book",
      "ShelfLocation": null,
      "CallNumber": "J 974.71 H",
      "Volume": null,
      "Status": "Transferred",
      "Barcode": "0000100000512",
      "LastActivityDate": "2015-09-23T15:35:26.23-04:00",
      "RecordStatus": "Final",
      "NonFilingTuple": "0004",
      "SortTitle": "STATUE OF LIBERTY AMERICAS PROUD LADY",
      "ItemStatusID": 1,
      "HasAlert": true,
      "WeedingAlertID": 1,
      "WeedingAlertDescription": "Last Available Copy",
      "WeedingAlertPrompt": "Prompt text here",
      "WeedingCriteriaID": null,
      "WeedingCriteriaName": null,
      "DiscardAmount": 5.00
    }
  }
]

HTTP Response Codes

Code Description
200 Record set contents returned. Success
404 Record set was not found.
403 Permission(s) not granted.

Preprocess Record Set Contents From Another Record Set

PUT /api/.../recordsets/{recordsetid}/records/bulkadd?sourceRecordSetID=0&objectTypeID=0&templateID=0

Before adding new records to an existing record set, preprocess the new records to determine the following based on the record set Id and object type:

  • Record is valid (exists in the database)
  • Record is not a duplicate (already exists in the record set)

Return view data if the record is valid and does not already exist in the record set. ViewData will be based on the record set's object type.

The list of IDs/barcodes contained within the request body must be unique.

Request Information

Parameters
Name Type Required Description
recordsetid Integer Yes The id of the record set.
sourceRecordSetID Integer Yes The id of the source record set.
objectTypeID Integer No Defaults to 0. Valid values are 0 (API will determine objectTypeID), 107 (Weeding).
templateID Integer No Defaults to 0. New weeding record sets require a valid template ID for preprocessing.

Response Information

Example Weeding Record Set Contents
application/json, text/json
[
  {
    "ObjectTypeID": 107,
    "SuppliedRecordID": 1,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 0,
    "IsValid": false,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": null
  },
  {
    "ObjectTypeID": 107,
    "SuppliedRecordID": 4,
    "SuppliedBarcode": null,
    "DatabaseRecordID": 4,
    "IsValid": true,
    "IsDuplicate": false,
    "RejectedReasonID": null,
    "RejectedReason": null,
    "Data": {
      "RecordID": 4,
      "Title": "The Statue of Liberty, America's proud lady",
      "AssignedBranch": "Southern Adirondack Library System",
      "Collection": "Children's Nonfiction (JNF)",
      "MaterialType": "New / Popular Book",
      "ShelfLocation": null,
      "CallNumber": "J 974.71 H",
      "Volume": null,
      "Status": "Transferred",
      "Barcode": "0000100000512",
      "LastActivityDate": "2015-09-23T15:35:26.23-04:00",
      "RecordStatus": "Final",
      "NonFilingTuple": "0004",
      "SortTitle": "STATUE OF LIBERTY AMERICAS PROUD LADY"
      "ItemStatusID": 1,
      "HasAlert": true,
      "WeedingAlertID": 1,
      "WeedingAlertDescription": "Last Available Copy",
      "WeedingAlertPrompt": "Prompt text here",
      "WeedingCriteriaID": null,
      "WeedingCriteriaName": null,
      "DiscardAmount": 5.00
    }
  }
]

HTTP Response Codes

Code Description
200 Record set contents returned. Success
404 Record set was not found.
403 Permission(s) not granted.

Update Record Set Contents

PUT /api/.../recordsets/{recordsetid}/records?isBarcodeList=false&isPreprocessing=false&objectTypeID=0

Add and remove records to an existing record set by supplying a list of record IDs (or barcodes). Barcodes may be supplied for item and patron record sets. You may not mix barcodes and IDs in the same operation.

Update will first process the removal of records and will then insert the records to be added. The entire operation is wrapped within a single transaction. If any error occurs, the entire operation will be rolled back.

Returns a summary of the number of records added, number of records removed, total number of records in the record set and any warnings that may have occurred during processing.

The list of IDs/barcodes contained within the request body must be unique.

Request Information

Parameters
Name Type Required Description
recordsetid Integer Yes The id of the record set.
isBarcodeList Boolean No Defaults to true. Supplied list is barcode. When set to false, list must be record Ids.
isPreprocessing Boolean Yes Enable preprocessing only. Set to false to update the record set. Ignored when adding via fileId.
objectTypeID Integer No Defaults to 0.
Example Body containing list of record IDs to add and remove
application/json, text/json
{
    "IDsToAdd": [1757137, 87865],
    "IDsToRemove": [134]
}

Response Information

Example Response
application/json, text/json
{
    "RecordSetId":36928,
    "NumberOfRecordsAdded":1,
    "NumberOfRecordsRemoved":0,
    "NumberOfRecords":5,
    "Warnings":[],
    "NotFoundRecordIDs": [],
    "DuplicateRecordIDs": [],
    "DuplicateFileRecordIDs": [],
    "RejectedRecordIDs": [],
    "ReportID": ""
}

HTTP Response Codes

Code Description
200 Success
404 Record set was not found.
403 Permission(s) not granted.

Preprocess Uploaded File

PUT /api/.../recordsets/{recordsetid}/records/file/{fileId}?locator=Sheet1:0&objectTypeID=27

Pre-process record IDs for an existing record set by supplying a file ID. The file must have been uploaded using the FileUpload API method. The file contains a list of record IDs. PatronID is used for patron record sets. Barcode is used for item record sets.

Pre-processing using a file will first verify the file exists. It then removes all duplicate entries from the file. If a list of IDs (integer) is supplied, it checks the list for valid ID values. Finally, it starts checking if the records exist and if they are already in the database.

Returns the following:

Request Information

Parameters
Name Type Required Description
recordsetid Integer Yes The id of the record set.
fileId String Yes FileID assigned when using FileUpload method.
locator String No Required when adding records from an Excel file. Represents the column identifier returned from the FileRead::GetFileInfo call.
objectTypeID Integer Yes Defaults to 0.
isBarcodeList Boolean No Supplied list contains barcodes.
isISBNList Boolean No Supplied list contains ISBNs.
Example Body containing list of record IDs to add and remove
application/json, text/json
{
    "RecordSetProcessingResults": [
        {
            "ObjectTypeID": 27,
            "SuppliedRecordID": 1,
            "SuppliedBarcode": null,
            "DatabaseRecordID": 0,
            "IsValid": false,
            "IsDuplicate": false,
            "RejectedReasonID": null,
            "RejectedReason": null,
            "Data": null
        },
        {
            "ObjectTypeID": 27,
            "SuppliedRecordID": 9057,
            "SuppliedBarcode": null,
            "DatabaseRecordID": 9057,
            "IsValid": true,
            "IsDuplicate": false,
            "RejectedReasonID": null,
            "RejectedReason": null,
            "Data": {
                "RecordID": 9057,
                "Barcode": "1000500062376",
                "PatronName": "King, Teresa M",
                "Street": "7th Lake Road ",
                "City": "SNELLVILLE",
                "State": "GA",
                "Zip": "30078-",
                "Library": "Crandall Public Library (Glens Falls)",
                "RecordStatusID": 1
            }
        },
        {
            "ObjectTypeID": 27,
            "SuppliedRecordID": 11111,
            "SuppliedBarcode": null,
            "DatabaseRecordID": 11111,
            "IsValid": true,
            "IsDuplicate": true,
            "RejectedReasonID": null,
            "RejectedReason": null,
            "Data": {
                "RecordID": 11111,
                "Barcode": "1000400118591",
                "PatronName": "Martin, Martha C",
                "Street": "104 Byard St ",
                "City": "ALTAMONTE SPRINGS",
                "State": "FL",
                "Zip": "32714-",
                "Library": "Schenectady County Public Library - Central",
                "RecordStatusID": 1
            }
        },
    ],
    "NotFoundRecordIDs": [
        "1"
    ],
    "DuplicateRecordIDs": [
        "11111"
    ],
    "DuplicateFileRecordIDs": [
        "11111"
    ],
    "FileSharedRecordISBNs": [
        [ "12345", "23456" ],
        [ "22222", "33333" ]
    ],
    "RejectedRecordIDs": [],
    "InvalidIDs": [
        "garbage"
    ]
}

Response Information

Example Response
application/json, text/json
{
  "RecordSetId": 36930,
  "NumberOfRecordsAdded": 0,
  "NumberOfRecordsRemoved": 0,
  "NumberOfRecords": 11,
  "Warnings": [
    "Record ID 1 not found.",
    "This record set already contains record ID 11111.",
    "This record set already contains record ID 57781."
  ],
  "NotFoundRecordIDs": [
    "1"
  ],
  "DuplicateRecordIDs": [
    "11111",
    "57781"
  ],
  "DuplicateFileRecordIDs": [],
  "InvalidIDs": [],
  "ReportID": "8c519d86-14f5-4338-957a-1e88e505d600_txt"
}

HTTP Response Codes

Code Description
200 Success
404 Record set was not found.
403 Permission(s) not granted.