Tech Blog

Update Item Information API – Enumeration Field

This blog post contributes another example of using the Update Item Information API (see also This example uses PowerShell.

Problem: We would like to update the Enumeration A fields in item records. However, the  Change Physical Items job does not allow for this functionality. (Note: this is no longer the case as of the June 2020 release. However, this procedure can easily be applied to other fields.) 

Solution: Use a PowerShell script with the Update Item Information API (PUT /almaws/v1/bibs/{mms_id}/holdings/{holding_id}/items/{item_pid}).

(see full documentation at


Starting with a list of barcodes, use the Item Barcode API (GET /almaws/v1/items?item_barcode={barcode}) to collect data points {mms_id}, {holding_id}, and {item_pid}.


#Define Starting Variables

$ItemData = “c:usersuserdesktopbarcodes.txt”​

$url_base = ‘’​

$url_params = ‘&apikey=’​

$apiKey = ‘superSecretKey’​

#Load List of Barcodes into Memory

$BarcodeList = Get-Content $ItemData -ErrorAction SilentlyContinue

#Define Script to Use Each Barcode

foreach ($BarcodeId in $BarcodeList) {​

#Run Item_Barcode API to Fetch Item XML​

$loadUrl = $url_base + $BarcodeId + $url_params + $apiKey​

[xml]$xml = (New-Object System.Net.WebClient).DownloadString(“$loadUrl”)

#Identify the Enumeration_A Field and Add Text “1” to It

$node = $xml.SelectSingleNode(“//enumeration_a”)​

$node.InnerText = “1”​

#Identify Components of Update Item InfoAPI​

$mmsID = $xml.item.bib_data.mms_id​

$holdingID = $xml.item.holding_data.holding_id​

$pidID = $​

#Construct Update Item Information API

$putURL = ‘’ + $mmsID + ‘/holdings/’ + $holdingID + ‘/items/’ + $pidID + ‘?apikey=’ + $apiKey​

#PUT XML Back into Alma with Updated Node via Update Item Information API

$Response = Invoke-WebRequest -Uri $putUrl -Method PUT -Body $xml -ContentType “application/xml”​

#Write out barcode (for pseudo-error reporting)

Write-Host $BarcodeId

#Close the ForEach


Note: there is a potential problem when using the Update Item Information API, if the item records are frozen/locked. Please see blog post for more information:

Leave a Reply