The autoSync or non-interactive transfer of basic patron profile data allows your IT Manager to set up a rolling transfer and update process between your school's administration system and Infiniti or LibPaths. This is a "set and forget" transfer facility which, once set up, will run according to the schedule implemented by your IT Manager. This process allows your school software to transfer records into Infiniti and LibPaths at scheduled intervals.


All patrons who require access to Infiniti or LibPaths must be registered with a basic account profile. Patron account profiles can be registered or updated via manual entry, manual ad hoc import, or automatic import using autoSync. After automatically transferring patron accounts, you can also optionally:

  1. autoSync patron contacts for email correspondence,
  2. autoSync patron images, and
  3. autoSync patron groups.
Patron profiles can also be permanently removed from Infiniti and LibPaths.


Before Getting Started


Infiniti's non-interactive patron transfer and update tool provides your school with a means of automating the synchronisation of patron information from your Student Management System or other appropriate source. Much like the ad hoc interactive patron import, this automated process accepts CSV (Comma Separated Value) files that you, or your IT team, have generated from your internal systems. 


This facility utilises a script created and scheduled by the school's suitably qualified IT Technician. The script is not intended for use by library managers or library staff and does not run in a browser. As an alternative, you can choose to use the interactive patron import


Prior to commencing the setup of automatic patron import and update please ensure you are familiar with the following:

  1. How to extract information, in CSV format, from your Student Management System or data source.
  2. The use of your preferred scripting tool and language.
  3. Basic knowledge of cross-platform non-interactive web agents (we recommend cURL but the are similar tools available).
  4. You school's Infiniti URL, which will be similar to: yourschool.concordinfiniti.com.
  5. The username and password of an account in your school's Infiniti with system administration privileges.

The CSV File

The first step in automating the synchronisation of your patron information is to create the CSV file which will be used by your script to transfer or update your users. The non-interactive user import requires specific header column names in the CSV file in order to recognise user attributes.

The CSV file used to transfer the data MUST contain the following fields:

username [varchar]: is the mandatory matching key for updating an existing user record or creating a new record - may be the same as your network logon if SSO required, Library barcode or Admin ID if SSO not required. Note: Ensure existing usernames to a new usernames match before proceeding.

enabled [boolean]: acceptable flags are:

  • active = Y, yes, true, 1.
  • inactive = N, no, false, 0.
    Note: This data is mandatory for all new users.

staffmember [boolean]: acceptable flags are:

  • staffmember = Y, yes, true, 1.
  • staffmember = N, no, false, 0.
    Note: This data is mandatory for staff members and students.
The CSV File you upload to Infiniti through this script MAY contain the following fields (please refer to manual patron import for a layperson's description of these fields):

givenname [string]: The patron's Given Name.
surname [string]: The patron's Surname.
middlename [string]: The patron's Middle Name.
preferredname [string]: The patron's Preferred Name (displayed in Circulation)
emailaddress  [email]: optional the patron's primary email address.

either

graduationyear [integer]: The year (YYYY) the patron will graduate from your school (mandatory only for students)

or

academiclevel [string]: the import ID as declared in Settings  > Cohorts > Academic Levels >  Import ID As Declared In Student Administration System (mandatory only for students)
Note: Exclude graduationyear and academiclevel for teacher profiles/data.

librarybarcode [varchar]: can be the same as Admin ID or Username but must be unique to this patron.The barcode used to identify the borrower in circulation (mandatory for borrowing items from the library).
adminsystemid [varchar]: the unique identifier used in your student management solution for this patron (can be identical to username and/or librarybarcode).
gender [varchar]: The patron's gender acceptable values are:
  • M
  • F or
  • blank
password [varchar]: the default password to set for the patron (optional and not required if using Single Sign On (SSO).
formclass [varchar]: the code that identifies the patron's Form Class (also known as Home Room, Class, Tutor Group, etc) in the current academic period, i.e., current school year.
presentationgrouplabel [varchar]: only required if the patron's presentation group is enabled use. Note: The presentation group must be a current presentation group added in Settings  >
Users > Display > Presentation Groups
.


The Non-interactive Script


Once your CSV is ready your import script is prepared by a suitably qualified IT technician and will HTTP POST a CSV file of users, extracted from your student administration system or similar source of user data, to this URL: https://[school.concordinfiniti.com]/api/import/users.


Infiniti will treat the first multi-part file of the HTTP POST as the CSV file - the file name and form attribute name of the post are ignored. The CSV file may be empty; for schools performing scheduled incremental imports.


The action is protected by HTTP Basic Auth over SSL/TLS. You will need to provide the username and password of a new or existing user with system administration privileges in Infiniti. Best practice is to create a new account in Infiniti for transferring data, e.g., autoimport, and grant this user system administration privileges. As SAML Single Sign-On requires a browser, the credentials for this user cannot be verified via SAML; one of the other credential sources will be required.


cURL Example


Your school's script can be implemented in any fashion chosen by your IT Technicians. An example of how a script may post the CSV file to Infiniti/LibPaths is the cURL application, a cross-platform non-interactive web agent:

 

curl -X POST -F "file=@users.csv" https://[user]:[password]@[yourschool.concordinfiniti.com]/api/import/users

 

The user CSV file will be processed in the same manner as the ad hoc interactive import, however the column headers are different.


PowerShell Example


Your school's script can be implemented in any fashion chosen by your IT Technicians. An example of how a script may post the CSV file to Infiniti/LibPaths is the Microsoft PowerShell 6 application:


# This script example requires PowerShell 6+
# Replace URI with relevant sub-domain for your Concord Infiniti service
$Uri = 'https://your-school.concordinfiniti.com/api/import/users'
# Replace the username with the username of user that exists in Infiniti with librarian permissions
# Replace the password with the relevant password. This is the same password you would use on the Infiniti login page; not necessarily the user's federated single sign-on credentials.
$Header = @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("username:password"))}
$Form = @{
file = Get-Item -Path 'C:\data\users-to-import.csv'
}
$Result = Invoke-RestMethod -Method POST -Header $Header -Uri $Uri -Form $Form# Optional, but the result can be parsed by PowerShell for the 'success': true/false and other information.
$AsJson = ConvertTo-Json $Result
echo $AsJson


The user CSV file will be processed in the same manner as the ad hoc interactive import, however the column headers are different.


Results of Processing


A sample CSV import file for existing users in could look like (you may have to authenticate): 

 

username,password,emailaddress,formclass
jane,swordfish,jane@gmail.com,10A
john,password1,john@gmail.com,10B

 

When complete the script will produce a JSON result array: 

'success' - Whether all user records transferred without error.

'summary' - A summary of the transfer action; successful or otherwise. 

'details' - An array of each user row outcome. Only included if some rows failed to import. "row number" -> "row outcome" 

  

A JSON result array can look like: 

 

{"success":true, "summary":"100 users processed. 50 users created. 50 users updated. 0 users failed."}

 

or 

 

{"success": false, "summary":"Unauthorised. Check credentials."}

 

or 

 

{
  "success": false,
  "summary": "3 users processed. 1 user created. 1 user updated. 1 user failed.",
  "details": {
    "1": "User Updated",
    "2": "Field (emailAddress) is not a well-formed email address. User failed to import: Field (emailAddress) is not a well-formed email address. ",
    "3": "User Created"
  }
}