Get user email from My Account of Primo NUI (BaseCamp thread)

Posted by Ian Chan on Apr 25

Hi,
Is it possible to retrieve the email of an authenticated user via AngularJS services in the Primo NUI? Having the user email would help with retrieving fine/fees data from the Alma API for use in a custom script for integration with online payment systems.

Thanks,

Ian


Jim LeFager 
Hi Ian. 

You should be able to retrieve the email address.  If I sign in and use the network tab in Chrome, I can see the data, including the email address at the following -- 


personal_settings?lang=eng
/primo_library/libweb/webservices/rest/v1/myaccount/personal_settings?lang=eng

Response: 
{"data":{"zip":"60018","smsnumber":"","address2":"1350 E Touhy Avenue Suite 150 W","city":"Des Plaines","address1":"1350 E Touhy Ave","editable":"Y","telephone1":"","mailattachement":"someone@example.com","librarynotices":{"librarynotice":[{"code":"FulUserBorrowingActivityLetter","editable":"Y","enabled":"Y"},{"code":"FulUserLoansCourtesyLetter","editable":"Y","enabled":"Y"},{"code":"FulUserOverdueNoticeLetter","editable":"Y","enabled":"Y"},{"code":"FulItemChangeDueDateLetter_STATUS","editable":"Y","enabled":"Y"},{"code":"FulItemChangeDueDateLetter_RECALL","editable":"Y","enabled":"Y"},{"code":"FulItemChangeDueDateLetter_RECALL_CANCEL","editable":"Y","enabled":"Y"}]},"addressvalidfrom":"20160909","password":"","state":"Illinois","patronstatus":[{"registration":[{"institution":[{"ilsinstitutioncode":"01SENC_INST","patronexpirydate":"","patronstatusname":"FTSTAFF","ilsinstitutionname":"Seneca College","patronstatuscode":"FTSTAFF"}]}]}],"email":"someone_else@example.com"},"errMsg":"Failure","control":[],"status":"failed","beaconO22":"187"}