Univention Bugzilla – Bug 52806
[Kelvin API] Allow mail address as identifier for resource "users"
Last modified: 2021-05-25 13:30:03 CEST
Currently, the resource "users" is defined via the username: https://<your-fqdn-here>/ucsschool/kelvin/v1/classes/users/{username} It should also be possible to use: https://<your-fqdn-here>/ucsschool/kelvin/v1/classes/users/{mailPrimaryAddress} Scenario: The source system behind the API client does not know the usernames, that are used in UCS@school. However, it does know about the email address associated with each user. I am aware, that we could use a GET command with searchfilter 'mailPrimaryAddress=yourname@maildomain.org', retrieve the username and then proceed with an update command (PUT/DELETE/PATCH) on that username, but with several thousand to tenthousand expected changes per day, the shortcut above would be very handy.
Mixed up the URLs ... should be: https://<your-fqdn-here>/ucsschool/kelvin/v1/users/{username} and https://<your-fqdn-here>/ucsschool/kelvin/v1/users/{mailPrimaryAddress}
Using the email address as primary key is common in admin REST APIs like for example the one from Google. It would be possible for us to implement this without an API change, as the syntax for usernames forbids an '@' in it. The code could work like this: if '@' in 'name' then get user by mailPrimaryAddress else use old behavior (get by username).