New Patron
General Purpose
The resource may be accessed with:
GET method – for retrieving the required parameters for creating a new patron.
PUT method – creation of new patron. This functionality allows user to perform self-registration to the system.
Product Version Compatibility
Versions 22.01 and later.
Interface Type
RESTful API
Hierarchy
Input Parameters
NA
Input URI
<BaseURL>:/patron/
For example: To retrieve the required parameters for creating new patron, use:
http://server.name:1892/rest-dlf/patron/
Input XML Format
To create a new patron with the PUT method use the same URL with a PUT method of HTTP.
The request “Body” of the “PUT” method must contain input XML with the Patron details, in the same structure of XML returned from the GET method.
Example: input XML body for the PUT action: (note the “post_xml=” on start.)
post_xml=<?xml version="1.0" encoding="UTF-8"?> <get-new-patron> <new-patron> <patron-name>Richardson, James the 1st</patron-name> <internal-id>0044</internal-id> <local-sub-library>LAW</local-sub-library> <internal-id-verification>0044</internal-id-verification> <con-lng>ENG</con-lng> <address>7 Ridgmount Street </address> <address-2>London WC1E 7AE </address-2> <address-3>United Kingdom </address-3> <address-4/> <zip/> <email-address>infouk@exlibrisgroup.com</email-address> <telephone-1>111222999</telephone-1> <telephone-2/> <telephone-3/> <telephone-4/> <sms-number/> <want-sms>Y</want-sms> <address-type>01</address-type> <address-valid-from>20150101</address-valid-from> <address-valid-to>20160712</address-valid-to> <gender>M</gender> <birthplace/> <birth-date/> <export-consent/> <mail-attachment/> <forgot-password-question/> <forgot-password-answer/> <field-1/> <field-2/> <field-3/> <note-1/> <note-2/> <home-library>LAW </home-library> <additional-id/> <additional-id-verification/> </new-patron> </get-new-patron>
Output XML Format
The returned XML from the GET method includes the parameters required for creating a new patron with the PUT method. List of possible values is retrieved for fields in which only specific set of values is supported.
The library can decide which are the possible values, and which are defaults that will be assigned to the new patron in ./alephe/tab/new_bor_register table. Please refer to the table’s header for more details.
Example (XML returned from the GET method):
<?xml version="1.0" encoding="UTF-8"?> <get-new-patron> <reply-text>ok</reply-text> <reply-code>0000</reply-code> <new-patron> <patron-name usage="Mandatory" max_len="200"/> <internal-id usage="Optional" max_len="12"/> <local-sub-library usage="Mandatory" max_len="5"> <local-sub-library-list Code="LAW">Law Library</local-sub-library-list> <local-sub-library-list Code="MED">Medicine Library</local-sub-library-list> <local-sub-library-list Code="WID">Main Library</local-sub-library-list> </local-sub-library> <internal-id-verification usage="Optional" max_len="20"/> <con-lng usage="Mandatory"> <con-lng-list Code="ENG" default="Y">English</con-lng-list> <con-lng-list Code="GER">German</con-lng-list> </con-lng> <address usage="Optional" max_len="200"/> <address-2 usage="Optional" max_len="200"/> <address-3 usage="Optional" max_len="200"/> <address-4 usage="Optional" max_len="200"/> <zip usage="Optional" max_len="9"/> <email-address usage="Optional" max_len="60"/> <telephone-1 usage="Mandatory" max_len="30"/> <telephone-2 usage="Optional" max_len="30"/> <telephone-3 usage="Optional" max_len="30"/> <telephone-4 usage="Optional" max_len="30"/> <sms-number usage="Optional" max_len="30"/> <want-sms usage="Optional" max_len="1"> <want-sms-list Code="Y"/> <want-sms-list Code="N"/> </want-sms> <address-type usage="Optional" max_len="2"> <address-type-list Code="01" default="Y">Permanent address</address-type-list> <address-type-list Code="02">Mailing address</address-type-list> <address-type-list Code="03">Student dorms</address-type-list> </address-type> <address-valid-from usage="Optional" max_len="8">20140112</address-valid-from> <address-valid-to usage="Optional" max_len="8">20140712</address-valid-to> <gender usage="Optional" max_len="1"> <gender-list Code="M">Male</gender-list> <gender-list Code="F">Female</gender-list> </gender> <birthplace usage="Optional" max_len="30"/> <birth-date usage="Optional" max_len="8"/> <export-consent usage="Optional" max_len="1"> <export-consent-list Code="Y"/> <export-consent-list Code="N"/> </export-consent> <mail-attachment usage="Optional" max_len="1"> <mail-attachment-list Code="H">Attachment Only</mail-attachment-list> <mail-attachment-list Code="P">Email Body Only</mail-attachment-list> <mail-attachment-list Code="B">Attachment and Email Body</mail-attachment-list> </mail-attachment> <forgot-password-question usage="Optional" max_len="2"> <forgot-password-question-list Code="01">01</forgot-password-question-list> <forgot-password-question-list Code="02">02</forgot-password-question-list> <forgot-password-question-list Code="03">03</forgot-password-question-list> <forgot-password-question-list Code="04">04</forgot-password-question-list> </forgot-password-question> <forgot-password-answer usage="Optional" max_len="16"/> <field-1 usage="Optional" max_len="200"/> <field-2 usage="Optional" max_len="200"/> <field-3 usage="Optional" max_len="200"/> <note-1 usage="Optional" max_len="200"/> <note-2 usage="Optional" max_len="200"/> <home-library usage="Optional" max_len="5"> <home-library-list Code="LAW">Law Library</home-library-list> <home-library-list Code="MED">MED</home-library-list> <home-library-list Code="WID">Main Library</home-library-list> </home-library> <additional-id usage="Optional" max_len="255"/> <additional-id-verification usage="Optional" max_len="20"/> </new-patron> </get-new-patron>
The above returned XML can be used for the structure that should be used for the PUT method.
If a new patron was successfully created using the PUT method, a reply such as the following will be reported:
<?xml version = "1.0" encoding = "UTF-8"?> <put-new-patron> <reply-text>ok</reply-text> <reply-code>0000</reply-code> <new-patron> <new-patron-id>0044</new-patron-id> <new-patron-internal-id>0044</new-patron-internal-id> <note type="info">Account created successfully. Please contact library to ensure your account rights.</note> </new-patron> </put-new-patron>
Possible Error Codes
Mandatory parameters are missing
The patron ID is already registered