The Banner view that Scott Wood assembled for the library, aka allBannerInfo.txt, includes the following fields. The number indicates their positions in the array and the field names in the users db table are in bold:
in order to create a user either 19 or 20 must be Y.
* 7-12 : addressType = Home; personal.addresses.primaryAddress = true
** 14 & 15 : addressType = Campus; these two fields need to be parsed together if there is any data in either one of them
*** 17 & 18 : if their is a campus phone number it should be put in personal.phone rather than the phone number in 13
JSON fields not informed by the above include
The previous version of FOLIO (Fameflower) required me to craft the user's UUID and I am very happy to discover that the current version (Goldenrod) does not. I'm putting my solution to crafting a UUID here so that I will always have it and never need it again:
sub craft_uuid {
$uuid = "";
$m = "12345";
$n = "89abAB";
$x = "0123456789abcdefABCDEF";
for ($y = 1; $y <= 8; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
for ($y = 1; $y <= 4; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
$r = int(rand(5));
$uuid .= substr($m,$r,1);
for ($y = 1; $y <= 3; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
$r = int(rand(5));
$uuid .= substr($n,$r,1);
for ($y = 1; $y <= 3; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
for ($y = 1; $y <= 12; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$json = `curl -s -w '\n' -X GET -H '$jsonHeader' -H '$xOkapiToken' $baseURL/users/$uuid`;
}
for ($infinity = 0; $infinity <= 1; $infinity++) {
craft_uuid();
if ($json =~ /Not found/) {
$infinity++;
} else {
$infinity--;
}
}