Patron Blocks

Patrons can be blocked for many reasons. They can be pre-defined blocks set up in the system, or they can be free-text blocks.

List Library-defined Blocks

GET /api/.../patronblocks?orgID={orgID}

Retrieve the list of library-defined blocks for a given organization ID.

Permissions

none

Request Information

Name Type Required Description
orgID Integer Yes ID of branch organization

Response Information

List of system-defined patron blocks

Example
application/json, text/json
[
    {
        "BlockID": 1,
        "Description": "See Note"
    },
    {
        "BlockID": 2,
        "Description": "Paid user fee at MEC"
    },
    {
        "BlockID": 3, 
        "Description": "Paid non-resident at WAT"
    }
]

HTTP Response Codes

Code Description
200 OK. Success
404 FAILURE. Invalid organization ID specified.

List Patron Blocks Summary

GET /api/.../patrons/{id}/blockssummary?logonBranchID={logonBranchID}&associatedblocks={false}

Return summary of blocks for patron.

Permissions

This call requires the PatronStatus_DisplayPatronBlocks (ID: 71) permission.

Request Information

Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.
logonBranchID Integer Yes Define this parameter in the request query string.
associatedblocks bool Yes Define this parameter in the request query string. If true, returns associated patron blocks only.

Response Information

Example
application/json, text/json
[
  {
    "PatronID": 1,
    "PatronFullName": "sample string 2",
    "BlockType": 3,
    "BlockID": 4,
    "BlockDescription": "sample string 5"
  },
  {
    "PatronID": 1,
    "PatronFullName": "sample string 2",
    "BlockType": 3,
    "BlockID": 4,
    "BlockDescription": "sample string 5"
  },
  {
    "PatronID": 1,
    "PatronFullName": "sample string 2",
    "BlockType": 3,
    "BlockID": 4,
    "BlockDescription": "sample string 5"
  }
]

HTTP Response Codes

Code Description
200 OK. Success
403 FAILURE. User or workstation is not privileged.
404 FAILURE. Invalid Patron ID.

Get Patron Free-text Block Details

GET /api/.../patrons/{patronid}/blocks/freetext/{blockid}

Get the details about a free-text block for a patron.

Permissions

This call requires the PatronStatus_DisplayPatronBlocks (ID: 71) permission.

Request Information

Parameters
Name Type Required Description
patronid Integer Yes The unique id assigned to the patron.
blockid Integer Yes The unique id assigned to the block.

Response Information

Example
application/json, text/json
{ 
    "PatronID": 588441,
    "PatronFullName": "Johnson, Steve L",
    "BlockID": 75248,
    "BlockDescription": "Patron owes more than $50.00 in late fees.",
    "CreatorID": 177,
    "CreatorName": "Joe.Smith",
    "CreationDate": 2016-12-11T08:43:23.743-04:00,
    "OrganizationID": 14,
    "OrganizationName": "Red Rock Public Library",
    "WorkstationID": 842,
    "WorkstationName": "JOE-PC",
    "ModifierID": 1051,
    "ModifierName": "Jane.Stevens",
    "ModificationDate": 2017-09-17T10:42:05.816-04:00
}

HTTP Response Codes

Code Description
200 OK. Success
403 FAILURE. User or workstation is not privileged.
404 FAILURE.
  • Invalid PatronID
  • Invalid BlockID
409 CONFLICT. Patron record is secured.

Get Patron Library-defined Block Details

GET /api/.../patrons/{patronid}/blocks/stops/{blockid}

Get the details about a library-defined block (stop) for a patron.

Permissions

This call requires the PatronStatus_DisplayPatronBlocks (ID: 71) permission.

Request Information

Parameters
Name Type Required Description
patronid Integer Yes The unique id assigned to the patron.
blockid Integer Yes The unique id assigned to the block

Response Information

Example
application/json, text/json
    
{ 
    "PatronID": 588441,
    "PatronFullName": "Johnson, Steve L",
    "BlockID": 5,
    "BlockDescription": "Message at Desk",
    "CreatorID": 177,
    "CreatorName": "Joe.Smith",
    "CreationDate": 2016-12-11T08:43:23.743-04:00,
    "OrganizationID": 14,
    "OrganizationName": "Red Rock Public Library",
    "WorkstationID": 842,
    "WorkstationName": "JOE-PC",
    "ModifierID": 1051,
    "ModifierName": "Jane.Stevens",
    "ModificationDate": 2017-09-17T10:42:05.816-04:00
}

HTTP Response Codes

Code Description
200 OK. Success
403 FAILURE. User or workstation is not privileged.
404 FAILURE.
  • Invalid PatronID
  • Invalid BlockID
409 CONFLICT. Patron record is secured.

Add Patron Block

POST /api/.../patrons/{id}/blocks

Add a library-defined or free-text block for a patron. The type of block is determined by the BlockType value in the posted data. A value of 1 indicates a free-text block, a value of 2 indicates a library-defined block.

Permissions

This call requires the PatronStatus_CreateDeletePatronBlocks (ID: 72) permission.

Request Information

Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.
POST Form Data

Provide the following in the form/body of the request:

Name Type Required Description
BlockType Integer Yes 1 (or 101) - Free-text, 2 (or 100) - Library-defined
BlockID Integer (see note) If BlockType is 2, this is the ID of the library-assigned block and is required.
BlockDescription Integer (see note) If BlockType is 1, this is the text of the free-text block and is required. It cannot be longer than 255 characters.

Response Information

Example
application/json, text/json
{
    "PatronID": 1,
    "PatronFullName": "sample string 2",
    "BlockType": 1,
    "BlockID": 434,
    "BlockDescription": "sample string 5"
}

HTTP Response Codes

Code Description
200 OK. Success
400 FAILURE.
  • Invalid BlockType
  • Invalid BlockID
  • Null or empty BlockDescription
  • BlockDescription longer than 255 characters
403 FAILURE. User or workstation is not privileged.
404 FAILURE. Invalid Patron ID.
409 CONFLICT. Patron record is secured.

Update Patron Block

PUT /api/.../patrons/{patronid}/blocks/{blocktype}/{blockid}

Modify a library-defined or free-text block for a patron.

Permissions

This call requires the PatronStatus_CreateDeletePatronBlocks (ID: 72) permission.

Request Information

Parameters
Name Type Required Description
patronid Integer Yes The unique ID assigned to the patron.
blocktype Integer Yes 1 (or 101) - Free-text, 2 (or 100) - Library-defined
blockid Integer Yes The unique ID assigned to the block being modified.
POST Form Data

Provide the following in the form/body of the request:

Name Type Required Description
BlockID Integer (see note) If BlockType is 2, this is the new ID of the library-assigned block and is required.
BlockDescription Integer (see note) If BlockType is 1, this is the new text of the free-text block and is required. It cannot be longer than 255 characters.

Response Information

Example
application/json, text/json
{
    "PatronID": 1,
    "PatronFullName": "sample string 2",
    "BlockType": 1,
    "BlockID": 434,
    "BlockDescription": "sample string 5"
}

HTTP Response Codes

Code Description
200 OK. Success
400 FAILURE.
  • Invalid BlockType
  • Invalid BlockID
  • Null or empty BlockDescription
  • BlockDescription longer than 255 characters
403 FAILURE. User or workstation is not privileged.
404 FAILURE. Invalid Patron ID.
409 CONFLICT. Patron record is secured.

Delete Patron Block

DELETE /api/.../patrons/{patronid}/blocks/{blocktype}/{blockid}

Delete a library-defined or free-text block for a patron.

Permissions

This call requires the PatronStatus_CreateDeletePatronBlocks (ID: 72) permission.

Request Information

Parameters
Name Type Required Description
patronid Integer Yes The unique id assigned to the patron.
blocktype Integer Yes 1 (or 101) - Free-text, 2 (or 100) - Library-defined
blockid Integer Yes The unique id assigned to the block.

HTTP Response Codes

Code Description
200 OK. Success
403 FAILURE. User or workstation is not privileged.
404 FAILURE.
  • Invalid PatronID
  • Invalid BlockType
  • Invalid BlockID
409 CONFLICT. Patron record is secured.