I am trying to use the papi api to update student addresses. Students have both a home address and a school address attached to their record. I am trying to use the PatronRegistrationUpdate Version 2 and PatronRegistrationCreate Version 2 endpoints to achieve this as needed. Based on the documentation it seems possible, but I cannot get the address to set at all with the update, and can only seem to set one address with the create.
The endpoint works for all the non-address settings, so I am confident it’s working outside of the address data. Below is the XML I am sending in the body of my request. Note, I’ve redacted identifying patron information with “XXXXX” and all other fields besides address appear to set. I am getting a success code as well even though the address isn’t set(PAPIErrorCode 0).
I haven’t reviewed this recently, but from what I recall, the issue with address updates might be linked to the PowerPAC settings. In my previous tests, the address update only took effect if the following setting was enabled: Profiles > PAC > Patron Access Options > Contact Info > Patron address set to “Patron can change without verification.”
Important: Enabling this setting opens the address fields in PowerPAC, allowing patrons to make unverified changes through “My Account.” I recommend testing this setting in a controlled environment, as it may grant unintended access.
Although I haven’t finalized my project, it seems that for us to enable this feature effectively, we might need to customize the PowerPAC files to hide the address fields in “My Account.” This way, any changes would go through a proper validation process.
We don’t let patrons update their addresses via self service (those fields are hidden in “my Account”), so there aren’t any impacts for us in turning off verification! They have to speak with a librarian to update that information.
@somaliajamall, Do you currently have custom code in place to hide the address fields on the PowerPAC page? And do you need to reapply this customization with each upgrade?
The reason I ask is that the setting mentioned above controls whether the address fields are accessible to patrons by default. In your test, you may not have seen the address fields become editable because PowerPAC needs to be recycled for the changes to take effect.
If you do have a customization in place and a standard process to replicate it with each upgrade, could you share any details? This is a challenge I’ll need to address soon to enable PAPI for address updates.
Using a custom theme with CSS set to display:none can visually hide the address fields, but this approach only conceals them superficially. Anyone with basic knowledge could inspect the page, adjust the CSS in their browser, and enter any information they wanted.
A more secure solution would be to remove the fields from the page entirely or set them to a fixed, non-editable value. This approach ensures that patrons cannot access or modify these fields, even if they attempt to manipulate the page’s code.
This is true, but a risk we’d be willing to accept for the ease of maintainability aspect. These are patrons that already have an account, one that they’ve already logged into in order to get to this page.
You might find a reverse proxy you could sit in front of PowerPAC that might allow you to do some manipulation of the raw page HTML. And of course editing the .aspx page would probably work. You could probably build up a script to edit the .aspx page after each upgrade to make the work a bit more sustainable too. But the price performance ratio of display: none is kinda of hard to beat.