Request Query
This service can be used to retrieve multiple requests submitted by patrons or other library as well as details of a request or to retrieve the details of a single request.
Request Query service URL for multiple requests
- http://HOSTNAME/portal-service/request/query/my?aid=${aid}&type=${query_type} [&xdays=${xdays}][&fullRecord=0/1]
${aid} is the authorization id for the user logged in. The {aid} is provided by the Authentication service.
${query_type} the following values may be substituted:
- xdays
- all
- open
- allposttoweb
- unopenedposttoweb
- onloan
${xdays} can be any positive number. It is a conditional parameter and required only when query_type is xdays.
${fullRecord} can be either 0 or 1. It is an optional parameter and by default is considered 0 if not included
HTTP Method: GET
HTTP Header User-Agent: ${user-agent}
Standard http clients (browser, http client libraries etc.) automatically include it's User-Agent value.
Examples
1. To retrieve all requests submitted in the last 7 days. Return full details for the requests.
http://HOSTNAME/portal-service/request/query/my?aid=12knsfd987234ldfd2&type=xdays&xdays=7&fullRecord=1
2. To retrieve all requests. Return the brief version of the request details.
http://HOSTNAME/portal-service/request/query/my?aid=12knsfd987234ldfd2&type=all&fullRecord=0
3. To retrieve all open requests. Return the brief version of the request details.
http://HOSTNAME/portal-service/request/query/my?aid=12knsfd987234ldfd2&type=open
4. To retrieve all requests for which documents were sent via post to web. Return the brief version of the request details.
http://HOSTNAME/portal-service/request/query/my?aid=12knsfd987234ldfd2&type=allposttoweb
5. To retrieve all requests for which documents were sent via post to web but have not been opened yet. Return the brief version of the request details.
http://HOSTNAME/portal-service/request/query/my?aid=12knsfd987234ldfd2&type=unopenedposttoweb
6. To retrieve all requests for which items are on loan. Return the brief version of the request details.
Request Query service URL for a single request
- http://HOSTNAME/portal-service/request/query/my/${REQUEST_NUMBER}?aid=${aid}
${REQUEST_NUMBER} is any valid Relais request number.
${aid} is the be the authorization id for the logged in user.
${fullRecord}can be either 0 or 1. It is an optional parameter and by default is considered 0 if not included
HTTP Method: GET
HTTP Header User-Agent: ${user-agent}
Standard http clients (browser, http client libraries etc.) automatically include it's User-Agent value.
Example
1. To retrieve request number PAT-10000001. Return the brief version of the request details.
http://HOSTNAME/portal-service/request/query/my/PAT-10000001?aid=12knsfd987234ldfd2
Response
The response from this service is a JSON string. The following is a sample response for a successful query.
{
"MyRequestRecordOverflow":true,
"MyRequestRecords":[
{
"RequestNumber":"PAT-10012688",
"Title":"THE CANADIAN JOURNAL OF NEUROLOGICAL SCIENCES / LE JOURNAL CANADIEN DES SCIENCES NEUROLOGIQUES",
"ArticleTitle":"A CANADIAN PARADOX: TOMMY DOUGLAS AND EUGENICS.",
"ArticleAuthor":"SHEVELL, MICHAEL",
"DateSubmitted":"2015-11-07 22:36:34.000",
"Volume":"Vol:39", *
"PublicationDate":"2010", *
"Issue":"NO:1", *
"Issn":"0317-1671", *
"PagesRequested":"35-", *
"DeliveryDate":"2015-11-23 12:31:24.000", *
"RequestStatus":"UNFILLED"
"RequestStatusDate":"2015-11-23 12:31:24.000",
"ExceptionCodeDesc":"NOL"
},
{
"RequestNumber":"PAT-10012688",
"Title":"A NEW GREEN HISTORY OF THE WORLD : THE ENVIRONMENT AND THE COLLAPSE",
"Author":"Ponting, Clive",
"DateSubmitted":"2015-11-10 16:41:39.000",
"DueDate":"2015-12-24 11:59:59.000",
"PublicationType":"B", *
"PublicationDate":"2007", *
"PublicationPlace":"New York", *
"Edition":"Rev. ed.", *
"Isbn":"9780143038986", *
"DeliveryDate":"2015-11-17 16:41:39.000", *
"RequestStatus":"ON_LOAN"
"RequestStatusDate":"2015-11-17 16:41:39.000",
"ExceptionCodeDesc":"LON"
},
]
}
The following values may be returned in the response:
Field |
Notes |
---|---|
RequestNumber |
|
Title |
|
SubTitle |
|
Author |
|
ArticleTitle |
|
ArticleAuthor |
|
SeriesTitle |
|
DateSubmitted |
|
ISO8601DateSubmitted |
format = yyyyMMddhhmmss |
NeedByDate |
|
ISO8601NeedByDate |
format = yyyyMMddhhmmss |
DueDate |
|
ISO8601DueDate |
format = yyyyMMddhhmmss |
DocumentURL |
|
Publisher * |
|
PublicationType * |
|
PublicationDate * |
|
PublicationPlace * |
|
Volume * |
|
Issue * |
|
Edition * |
|
Issn * |
|
Issn2 * |
|
Isbn * |
|
Isbn2 * |
|
Ismn * |
|
PagesRequested * |
|
DeliveryDate * |
|
ISO8601DeliveryDate |
format = yyyyMMddhhmmss |
AllowRenew: |
true / false |
AllowCancel |
true / false |
|
|
RequestStatusDate |
|
ISO8601RequestStatusDate |
format = yyyyMMddhhmmss |
ExceptionCodeDesc |
|
Note: The fields marked with an asterisk are included in the response for 'multiple requests' if {$full record=1}. All fields are included in the response for a single request.
The following request statuses may be returned:
- ENTERED
- IN_PROCESS
- CANCELLED
- UNFILLED
- SHIPPED
- ARTICLE_SENT
- ON_LOAN
- OVERDUE
- COMPLETE
- UNKNOWN
Authorization id
Both services first validate the authorization id. If the authorization id is invalid then the following response is returned:
{
"AuthorizationState": {
"AuthorizationId": "YkbOGfGv6hKLefABkWJP2yYlI8",
"State": false
}
}
Error messages
The following problem codes and messages may be returned
Code
|
Type
|
Message
|
---|---|---|
PUBQR004 |
Public |
No result for query |
PUBQR008 |
Public |
Missing myRequest query parameters |
PUBQR009 |
Public |
Unsupported myRequest query parameter |
PUBAZ003 |
Public |
Proctor - missing parameters for validating authorization |
PRIQR001 |
Private |
Internal query request error |
PRIDA001 |
Private |
Internal data access error |
PRIAZ001 |
Private |
Internal authorization error |
Example
The following is a sample response for an unsuccessful query:
{
"Problem": {
"Code": "PUBQR004",
"Message": "No result for query"
}
}