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


Before Getting Started


This method of importing from a scripted school server is optional and supplemental to the primary interactive web interface where librarians can upload or revise patron images using their browser via the ad hoc interactive patron image import. The non-interactive scripted transfer method described on this page does not use a browser and requires qualified school IT technicians with the authority and expertise to send school patron photos to Infiniti’s server directly with a script of the technician’s own choosing and timing.


The rest of this document is for the benefit of school IT technicians; who can decide if scripted import of patron images is appropriate and practical for your library. The option to  upload photos without human intervention (non-interactively) can allow for schools to supply new or revised photos on a regular basis, and without librarians having to be directly involved.


Concord Support will not provide the script – as this will differ by server ecology, methodology, and a school technician’s preferred skill set. A technician should assess whether the advantages of scripted import outweigh the disadvantages of script creation and maintenance. Scripting advice from Concord Support is limited to outlining available import channels and their respective requirements. Any scripting examples provided below are for illustrative purposes; they are not supported scripts, and may not qualify as appropriate for your school’s production server ecology.


Technical Prerequisites

 

Expertise in a scripting language that can run on a school (or school cloud) server with access to the source of patron photos, their student administration IDs, and your Infiniti web site (the Internet).

 

An Infiniti account with “System Administration” privileges. The script will use this account’s credentials to upload the photos. Concord recommends this to be an account created and used solely for the import script. The account can authenticated with Infiniti’s internal database or against Active Directory (LDAPS) if configured. Federated single sign-on solutions like SAML or OpenID Connect are not available for script access.

 

Patron photos in JPEG or PNG format. Note: BMP, GIF, and WebP are not supported. Images supplied are automatically shrunk by Infiniti to dimensions suitable for the library circulation desk. To avoid this processing overhead or reduce image compression artefacts, the script can opt to supply photos with dimensions no larger than 200x200 pixels.

 

A script environment capable of scheduling; with suitable support tools or language capability for compression, multi-part file posting over HTTPS, and JSON parsing.

 

The Endpoints

 

Infiniti has two upload endpoints that can be used by scripts to supply patron photos. An end-point to supply multiple photos in a zipped file; and an end-point to supply photos one at a time. The zipped endpoint reflects similar behaviour to the browser-based interactive upload and has similar upload limitations. Concord recommends the per-photo (individual) upload process for scripts – as scripts can better control which photos and react to import errors in a more precise way.

 

For the rest of the document the following nomenclature applies:

[infiniti host] – This is your Infiniti service. In the format of “your-school.concordinfiniti.com” or “your-school.concordinfiniti.co.uk” where “your-school” is known by the library staff.

[script] – This is your script. It may be any language, hosted inside the school or running on the school’s cloud providers. For illustration purposes, this document will use the syntax of a Linux shell script.

[username] – The username of the Infiniti account that the script will be uploading as.

[password] – The password of the Infiniti account that the script will be uploading as.

[image filename] – The filename of the image. Whether a direct single image or the filename of an image within a zip file.

[patron administration id] – The ID for the patron. This is the Admin System ID in Infiniti and should be the same ID extracted from the student administration system or other source for photos.

 

Image filenames must follow an exact format in order for Infiniti to link a photo to a patron:

[patron administration id].[image file extension]

 

Endpoint 1: Individual Photo Import

 

https://[username]:[password]@[infiniti host]/api/import/userImage

 

Note: Credentials are supplied to Infiniti by HTTP Basic Authentication. Whether the credentials are declared directly in the URL or added as parameters will depend on the scripting language and the HTTPS posting tool used.

 

The script will post to this endpoint the patron image as a multipart file with attribute name “file”, no larger than 100MiB (ideally much smaller).

 

For instance, an example using the cURL tool:

#/bin/bash

curl -X POST -F "file=@[image filename]" https://[username]:[password]@[infiniti host]/api/import/userImage

 

The script will need to communicate with HTTPS; as Infiniti will refuse insecure HTTP connections.

 

Infiniti will reply to a successful import with a JSON string that script can choose to examine or log for future review by school technicans.

An example of a successful JSON reply:

{

   "success":true,

   "summary":"Updated profile image for '<last_name>, <first_name>' with Admin System Id '123'"

}

The summary field is intended for human readable logging. The success field may be used by the script to decide on further actions regarding that image.

 

Unsuccessful uploads may fail before the Infiniti image importer participates in the process (for instance connectivity or authentication errors), in which case the error handling will differ by script and script ecology. If the import process itself rejects the import, you will see a JSON reply similar to this:

{

  "success": false,

  "summary": "Admin System Id (1234) found from file name (1234.jpg) is not unique."

}

 

Endpoint 2: Zipped Batch of Photos

 

https://[username]:[password]@[infiniti host]/api/import/userImage/multiple/compressed

 

This endpoint is generally less relevant for scripts but aligns with similar behaviour in browser-mediated manual import of patron photos.

 

The same 100 MiB upload limit will apply to the zip file, restricting how many images can be contained in a given zip upload – unless files within the zip are of suitably small dimensions (200x200 pixels or less).

 

The filename of each image within zip file should follow the image filename standard described earlier; and should be stored directly within the zip file root with no folders or sub-folders.

 

Infiniti will accept zip files compressed in either the PKZIP standard or the 7Zip standard. Infiniti will also attempt to decompress files held in the gzip, bzip2, deflate, lz4, pack200, snappy, tarballs, and other formats on a best-effort basis.

 

JSON results are presented as summary for the overall zip import and optionally the result of each file within the zip file, if requested. To request per-file results in the reply, include a query parameter of “details=true” in the endpoint post action.

 

Summary example:

{

  "success":true,

   "summary":"10 user images loaded successfully. 2 user images failed to load."

}

Note that the summary field is not machine readable; and the success field will be true for any import that didn’t fail outright. To detect partial imports, parsing a detailed reply is recommended:

{

  "success":true,

   "summary":"1 user images loaded successfully. 2 user images failed to load.",

  "details":[

    {

       "file_name":"123.png",

       "success":true,

      "notes":"Updated profile image for '<last_name>, <first_name>' with  Admin System Id '123'."

    },

    {

       "file_name":"456.jpg",

       "success":false,

       "notes":"Cannot find user for Admin System Id '456'."

    },

    {

      "file_name":"789.csv",

       "success":false,

       "notes":"File is not a supported image file."

    }

  ]

}

 

Scripting Advice

 

If scheduling the script to periodically upload photos, Concord recommends that only photos that are new or have changed are uploaded.

 

In the case of bulk imports, Concord recommends that a “trial” import of a few photos through the script is attempted and reviewed, before importing all photos through scripts, or scheduling the script for routine import.

 

Librarians should be informed that photos are being uploaded via script; when the script runs; who in the school maintains the scripts; and what Infiniti account is used by the script, so librarians don’t accidentally disable that account.

 

Technicians should choose a script language known by other school technicians and a script location accessible to other school technicians. Concord has encountered cases of two scripts performing the same import from successive implementations by different technicians.


Tip: Best practice is to prepare a trial import file with a small number of images, import these and confirm results prior to processing a bulk set of images.