© 2024 Clarivate
POST /api/.../holdsprecheck
Check is patron is blocked from placing new hold requests.
This call requires the HoldRequests_Create (ID: 89) permission to create the request and the OverrideRequestBlocks_Allow (ID: 132) permission to override hold request blocks.
Before allowing a user to fill out the form for a new hold request, this method can be called to check if the patron is blocked from creating a new hold request. This process is "conversational" in nature.
The body of the REQUEST calls to the API will follow this general pattern:
application/json, text/json
{
ProcedureStep: 20,
Answer: 1,
PatronID: 357971
}
The body of the RETURNED calls will follow this general pattern:
application/json, text/json
{
ProcedureStep: null,
Answer: null,
HoldRequestID: null,
DuplicateHoldRequests: null,
PAPIProcedure: 0,
PAPIProcedureStep: 2,
PAPIAction: 2,
PAPIActionProcedure: 0,
PAPIPromptType: 4,
PAPIStopType: 0,
PAPIReturnCode: -4008,
PatronBlocks: null,
LinkedPatronBlocks: null,
Success: false,
Message: "Patron is blocked. Do you want to continue with this operation?"
}
The initial API request should have a ProcedureStep value of 1 (Start). Check the returned values for the Success attribute as an indication if adding the new hold request was successful.
For cases where Success is false, check the other PAPI* attributes for what is required next in order to resubmit the API request. The PAPIProcedureStep may contain any of the following values if the Success attribute is false:
Continue this workflow until PAPIStopType comes back as 1 (Exit), and there are no further procedure steps.
For PAPIProcedureStep 2 (patron blocks), summary data for the list of patron blocks will be returned in the PatronBlocks and LinkedPatronBlocks properties. (See the 'Patron Blocks' API call for more detailed information on the format of the data in those lists). They can be displayed to the user for acknowlegment or bypass. The data is returned in the following format:
application/json, text/json
{
ProcedureStep: null,
Answer: null,
HoldRequestID: null,
DuplicateHoldRequests: null,
PatronBlocks:
[
{
PatronID: 222,
PatronFullName: "John Smith",
BlockType: 1,
BlockID: 45629,
BlockDescription: "Test Block Description"
},
{
PatronID: 222,
PatronFullName: "John Smith",
BlockType: 1,
BlockID: 45631,
BlockDescription: "Patron has overdue items"
},
{
PatronID: 222,
PatronFullName: "John Smith",
BlockType: 1,
BlockID: 45632,
BlockDescription: "Verify Address"
}
],
LinkedPatronBlocks:
[
{
PatronID: 2143,
PatronFullName: "Jane Smith",
BlockType: 1,
BlockID: 4563,
BlockDescription: "Test Block Description"
}
],
PAPIProcedure: 0,
PAPIProcedureStep: 2,
PAPIAction: 2,
PAPIActionProcedure: 0,
PAPIPromptType: 4,
PAPIStopType: 0,
PAPIReturnCode: -4008,
Success: false,
Message: "Patron is blocked. Do you want to continue with this operation?"
}
Provide the following in the form/body of the request:
Name | Type | Required | Description |
---|---|---|---|
ProcedureStep | Integer | Yes | (see above) |
Answer | Integer | No | (see above) |
PatronID | Integer | Yes |
Code | Description |
---|---|
200 | OK. Check body for conversational procedure status, continue until process is complete. |
400 |
FAILURE due to invalid input or data validation. |