How to create a user via an API in your institution in 5 easy steps.
However, this blog focuses on your institution and not a generic sample, so that you will have an example with, for example, your user group, job category, user identifier types, etc.
Identify an existing user in Alma similar to the one you want to create. This user will be used as a “template” for the new user.
Be sure to use sandbox or production depending on API key you will use.
In the example here we will use:
User Mary Bell, Primary Identifier MaryB613. She has user group “Undergraduate Student” and roles “Patron” and “Trial Participant”.
Do a GET on the user and save the XML in a local file for editing.
Here is the syntax (of course replace “01234567890” with your real API key):
Edit the output from the GET above as follows to use as input for the POST to create the new user.
- Change the Primary ID to one that does not already exist
- Change the first name, middle, last name and full name
- Change the values of the user identifiers to ones that do not already exist
Do a POST as follows:
In the Body choose application/xml and put in the edited output from the GET above.
Get response which will include the new user
See the new user in Alma and see that it was created from the API and has all of the values you sent.