Need help finding the User Identifier Type code table.  XML
Forum Index » Alma
Author Message
mcmunnw



Hello,

This page:

https://developers.exlibrisgroup.com/alma/apis/users/PUT/gwPcGly021r0XQMGAttqcPPFoLNxBoEZSZhrICr+9So=/0aa8d36f-53d6-48ff-8996-485b90b103e4

(APIs > Users > Update User Details)

... refers to a User Identifier Type code table in reference to locating a value for the user_id_type parameter of the Update User Details API operation, but doesn't go as far as saying where this table is located.

I did some searching and found this page:

https://developers.exlibrisgroup.com/alma/integrations/user-management

... which says:

The User Identifier Type code table (configured by Ex Libris staff, but accessible in read-only format from the Alma Developers page) defines the additional identifiers.

... but once again no mention of where to find such a table.

I require this parameter as I am attempting to update a user's XML and am getting this error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<web_service_result xmlns="http://com/exlibris/urm/general/xmlbeans">
<errorsExist>true</errorsExist>
<errorList>
<error>
<errorCode>401858</errorCode>
<errorMessage>The external id in DB does not fit the given value in xml - external id cannot be updated.
(Tracking ID: E01-1003193841-69PD8-AWAE2124448477)</errorMessage>
</error>
</errorList>
</web_service_result>

I'm hoping that if I relegate searching to just the users's primary_id, the update will succeed.

Many thanks.
tamarf



Hi,
You can see the table (as read only) in Alma UI: user management menu - User Identifier Types.
In addition, you can get it using the code tables API:
GET /almaws/v1/conf/code-tables/UserIdentifierTypes

Thanks,
Tamar
mcmunnw



Thanks.

Unfortunately, using the "Code" values in the "User Identifier Types" table didn't resolve the matter.

The error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<web_service_result xmlns="http://com/exlibris/urm/general/xmlbeans">
<errorsExist>true</errorsExist>
<errorList>
<error>
<errorCode>401858</errorCode>
<errorMessage>The external id in DB does not fit the given value in xml - external id cannot be updated.
(Tracking ID: E01-1003193841-69PD8-AWAE2124448477)</errorMessage>
</error>
</errorList>
</web_service_result>

... only seems to occur while trying to update external users. I can update internal users just fine.

Any idea how to overcome this problem?

I'm wondering if I could just limit the search to the user's "Primary identifier", perhaps the update would stop trying to match on the user's external id (which I'm guessing is the problem).

Ive tried the following variations in the "user_id_type" field:

primary_identifier
primary identifier
primary_id
primary id
primary

... but each time, I get a response like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<web_service_result xmlns="http://com/exlibris/urm/general/xmlbeans">
<errorsExist>true</errorsExist>
<errorList>
<error>
<errorCode>401862</errorCode>
<errorMessage>Identifier type primary does not exist.
(Tracking ID: E01-1103163752-USZCO-AWAE1463711610)</errorMessage>
</error>
</errorList>
</web_service_result>

This message was edited 1 time. Last update was at 11/03/2015 16:38:59

mcmunnw



I may have found a solution although I'd like your opinion on it (to make sure it's safe to do).

I simply removed:

<external_id></external_id>

... from the request XML.

What my script is doing sum total is:

1) GET'ing the user xml
2) Modifying the user XML (adding a block)
3) PUT'ing (updating) the user XML

I understand that updating the user's XML happen in "Swap All" mode as per this page:

https://developers.exlibrisgroup.com/alma/apis/users/PUT/gwPcGly021r0XQMGAttqcPPFoLNxBoEZSZhrICr+9So=/0aa8d36f-53d6-48ff-8996-485b90b103e4

This Web service updates a specific user's details. It is possible to update an external user, internal user or update an internal user to be an external. Note that the update is done in a Swap All mode: existing fields' information will be replaced with the incoming information. For external users, the following fields are not replaced if they were updated manually (or if they are empty in the incoming user record): User group, Job title, PIN number, User language.

Basically, I'm just looking for reassurance that I'm not deleting the user's external_id by not including that element in the request XML.

Thanks.
tamarf



Hi,
It is not recommended to remove the <external_id> tag.
This tag is the code of the SIS profile which was used to load the external user.

If you perform GET, and use the output for PUT (with the addition of a block), it looks like the user was loaded with a profile which does not exist anymore or changed.
Please check the <external_id> tag you retrieve by the GET: is this a valid, active profile of SIS?

Thanks,
Tamar
mcmunnw



So how do I get around the error if not by removing the <external_id> element which in my test case does not contain a value as in:

<external_id></external_id>

Here is my initial GET XML structure (with personally identifiable info removed):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<record_type desc="Public">PUBLIC</record_type>
<primary_id></primary_id>
<first_name></first_name>
<middle_name></middle_name>
<last_name></last_name>
<full_name></full_name>
<pin_number></pin_number>
<job_category desc=""></job_category>
<job_description></job_description>
<gender desc=""></gender>
<user_group desc="Student Patron Profile">Student</user_group>
<campus_code desc=""/>
<web_site_url></web_site_url>
<preferred_language desc="English">en</preferred_language>
<account_type desc="External">EXTERNAL</account_type>
<external_id></external_id>
<password></password>
<force_password_change></force_password_change>
<status desc="Active">ACTIVE</status>
<contact_info>
<addresses>
<address preferred="true" segment_type="Internal">
<line1></line1>
<city></city>
<state_province></state_province>
<postal_code></postal_code>
<country/>
<address_note></address_note>
<address_types>
<address_type desc="Home"></address_type>
</address_types>
</address>
</addresses>
<emails>
<email preferred="true" segment_type="Internal">
<email_address></email_address>
<email_types>
<email_type desc="Personal">personal</email_type>
</email_types>
</email>
</emails>
<phones>
<phone preferred="true" preferred_sms="false" segment_type="Internal">
<phone_number></phone_number>
<phone_types>
<phone_type desc="Home">home</phone_type>
</phone_types>
</phone>
</phones>
</contact_info>
<user_identifiers>
<user_identifier segment_type="Internal">
<id_type desc="Barcode">BARCODE</id_type>
<value></value>
<status>ACTIVE</status>
</user_identifier>
</user_identifiers>
<user_roles>
<user_role>
<status desc="Active">ACTIVE</status>
<scope desc="University of Manitoba">01UMB_INST</scope>
<role_type desc="Patron">200</role_type>
<parameters/>
</user_role>
</user_roles>
<user_blocks/>
<user_notes/>
<user_statistics>
<user_statistic segment_type="Internal">
<statistic_category>Environment</statistic_category>
</user_statistic>
</user_statistics>
</user>

If I try to PUT the above XML back into the API through the API explorer (even without adding a block), I get the error:

The external id in DB does not fit the given value in xml - external id cannot be updated.
(Tracking ID: E01-1203181250-N11WF-AWAE479379685)

If I remove the <external_id> element, here is the response XML to my PUT (after adding a block):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<record_type desc="Public">PUBLIC</record_type>
<primary_id></primary_id>
<first_name></first_name>
<middle_name></middle_name>
<last_name></last_name>
<full_name></full_name>
<pin_number></pin_number>
<job_category desc=""></job_category>
<job_description></job_description>
<gender desc=""></gender>
<user_group desc="Student Patron Profile">Student</user_group>
<campus_code desc=""/>
<web_site_url></web_site_url>
<preferred_language desc="English">en</preferred_language>
<account_type desc="External">EXTERNAL</account_type>
<external_id></external_id>
<password></password>
<force_password_change></force_password_change>
<status desc="Active">ACTIVE</status>
<contact_info>
<addresses>
<address preferred="true" segment_type="Internal">
<line1></line1>
<city></city>
<state_province></state_province>
<postal_code></postal_code>
<country/>
<address_note></address_note>
<address_types>
<address_type desc="Home"></address_type>
</address_types>
</address>
</addresses>
<emails>
<email preferred="true" segment_type="Internal">
<email_address></email_address>
<email_types>
<email_type desc="Personal">personal</email_type>
</email_types>
</email>
</emails>
<phones>
<phone preferred="true" preferred_sms="false" segment_type="Internal">
<phone_number></phone_number>
<phone_types>
<phone_type desc="Home">home</phone_type>
</phone_types>
</phone>
</phones>
</contact_info>
<user_identifiers>
<user_identifier segment_type="Internal">
<id_type desc="Barcode">BARCODE</id_type>
<value></value>
<status>ACTIVE</status>
</user_identifier>
</user_identifiers>
<user_roles>
<user_role>
<status desc="Active">ACTIVE</status>
<scope desc="University of Manitoba">01UMB_INST</scope>
<role_type desc="Patron">200</role_type>
<parameters/>
</user_role>
</user_roles>
<user_blocks>
<user_block segment_type="Internal">
<block_type desc="Cash">CASH</block_type>
<block_description desc="Account sent to Registrars Office">REGISTRAR</block_description>
<block_status>ACTIVE</block_status>
</user_block>
</user_blocks>
<user_notes/>
<user_statistics>
<user_statistic segment_type="Internal">
<statistic_category>Environment</statistic_category>
</user_statistic>
</user_statistics>
</user>

If you analyze the before and after XML (do a difference comparison), the only thing that's different is the addition of the block.

Should the <external_id></external_id> that I am initially GET'ing contain a value?

Is the error being thrown because <external_id> that I am PUT'ing into the API doesn't contain a value? If so, wouldn't this be a bug with the API (returning an empty <external_id></external_id> element to begin with)?
mcmunnw



It seems that this problem is occurring with any patron record where the account type is external:

<account_type desc="External">EXTERNAL</account_type>

If I GET the user's XML (code or API Explorer) and then subsequently PUT the user's info. back into the API (unchanged), I am able to duplicate the error.

I should mention that I am doing all of the above within the context of our Alma Sandbox deployment (not sure if that helps).
mcmunnw



Little bit more information...

I looped through 192 user records in both our Sandbox and Production systems to check for 3 user values:

<account_type>
<external_id>
<status>

In all but one case where the <account_type> was EXTERNAL, the <external_id> had no value (was empty).

The <status> on all records was ACTIVE.

In the one case where <external_id> had a value (occurred in our Sandbox), it was set to:

<external_id>SIS_temp</external_id>

Earlier I had updated this very record but excluded the <external_id></external_id> element which seems to indicate that not including it does not overwrite any existing value.

Anyway, if you can tell me how to update a users record while including the <external_id></external_id>, I'll be very happy.
mcmunnw



Would adding a value (such as the primary identifier) to the user_id_type request parameter help?

If so, what would I enter as a value?

As previously mentioned, I've tried all of the following (trying to guess the correct value):

primary_identifier
primary identifier
primary_id
primary id
primary

... but none of the above worked. I don't see any documentation as to how limit the search to primary id.

Thanks.

This message was edited 1 time. Last update was at 13/03/2015 17:06:01

mcmunnw



Had a meeting with a few others and I have learned that we do not have an SIS profile set-up. Apparently, our patrons were loaded in by Ex LIbris.

So, in light of the fact that were are not using an SIS profile, is it safe to update external user records while omitting the <external_id> (which seems to allow me to do the update while preserving any existing value in the <external_id> element)?

Once again, the problem only seems to apply to external users.

This message was edited 1 time. Last update was at 13/03/2015 19:30:12

mcmunnw



Some additional test results:

1)

If an external user has a value in external_id (GET request), we can update the user (PUT request) as long as we don't change it's value.

2)

If we do change it's value, we get the error I've been getting all along (PUT'ing the external_id with no value):

The external id in DB does not fit the given value in xml - external id cannot be updated.

3)

As described in 2) If we remove the value within the external_id element, we get the error:

The external id in DB does not fit the given value in xml - external id cannot be updated.

4)

If we simple remove the external_id element from the request, the update works and the response xml (of the updated record) shows that the original external_id value is not overwritten.

==

There is another developer here who is able to update users using the SOAP Users API so the problem seems to exist only with the REST Users API.
tamarf



Hi,
As you mentioned, situation of user that is external (i.e. <account_type desc="External">EXTERNAL</account_type> ), but have empty external_id tag is situation that is wrong and should not happen.

External users are always created with external_id - which is the profile id of the relevant SIS profile they were loaded with.

I do not know how the above situation happened in your data, but you can see it is not the common situation (only 1 such user exists for you, right?)

The best solution would be to re-create this user correctly.
If this is not possible, then perhaps you can add logic such as:
if external_id tag is empty from GET, remove it for PUT.
but only in the above case.

Thanks,
Tamar
 
Forum Index » Alma
Go to: