Tech Blog

Working with the code tables API

The GET /almaws/v1/conf/code-tables/{codeTableName} API enables retrieving all rows of a code table. Each row contains a code and its related description.

The main usage of it is for applications that are based on Alma APIs, and would like to preset the user a drop-down of valid values to choose from.

For example, let’s assume I am writing a user management application. In this application, I am using the Alma users API. I want to create a form for adding a new user. The form will display the fields, and after the user fills it and submits the form, the create-user (POST) API will be used.

You can see in the user object documentation that there are fields with a limited list of possible values. These values are usually defined in a code table:

In my application, I should use the GET /almaws/v1/conf/code-tables/{codeTableName} API in order to retrieve the list of possible values and display them as a drop-down on my form.

The relevant code table name can be found in the documentation:

And also in the XSD itself, in the annotation – xs:appinfo – xs:codeTable tag of the relevant field:

So in my application, I can use GET /almaws/v1/conf/code-tables/UserGroups. Example for calling the API from the API console:

Please note that in the UI, we have both the table name and the table code. The table code should be used as a path parameter in the code tables API:

6 Replies to “Working with the code tables API”

  1. We too require an writable code tables API, especially for keeping user statistics like University departments and majors up-to-date. The alternative is manual entry, one by one, on the web interface as University department names and majors change. We need a pure systematic approach instead of human cognizance of every change at the University, then manual management of the table…

    By University of North Carolina at Charlotte 01UNCC_INST on September 27, 2017 at 4:27 PM

  2. Regarding user_statistic code table updates, our testing shows that only 2 of the 3 required tables for user statistics are available for update via the API

    AVAILABLE
    [1] UserStatisticalTypes = Category Types
    https://api-eu.hosted.exlibrisgroup.com/almaws/v1/conf/code-tables/UserStatisticalTypes?scope=Institution%20Code&apikey=removed

    AVAILABLE
    [2] UserStatCategories = Statistical Categories
    https://api-eu.hosted.exlibrisgroup.com/almaws/v1/conf/code-tables/UserStatCategories?scope=Institution%20Code&apikey=removed

    UNAVAILABLE! ALMA CONFIGURATION API DOES NOT HAVE A CODE TABLE FOR UPDATE
    [3] StatisticalCategoriesTypes = Statistical Categories/Types
    https://api-eu.hosted.exlibrisgroup.com/almaws/v1/conf/code-tables/StatisticalCategoriesTypes?scope=Institution%20Code&apikey=removed

    Note that the names for these code tables can be found in the Alma URL when looking at a specific table. This is true for the first 2 and also the third, that is, StatisticalCategoriesTypes (in other words, this is how we guessed what the code table name should be for StatisticalCategoriesTypes). Of course, the third also does not appear in the Developer Network documentation.

    This is the error we receive when trying to access the table

    true

    90101
    Table does not exist.
    E02-1104114211-DJ0ZM-AWAE877393040

    It seems reasonable that if the first 2 tables in a 3-table process can be updated via API, also the 3rd table in the process should be available. This seems like a bug that it is not.

  3. Dear friend from the Weizmann Institute,

    The 3rd one is a mapping-table – please try:
    /almaws/v1/conf/mapping-tables/StatisticalCategoriesTypes

    Hope this helps,
    Ori

Leave a Reply