Managing users with APIs

Typically, all users are managed via the User sync and data migration. This page explains how to use APIs to manage users instead.

In Haplo products, there is a separation of a user and a person’s “object”, which is the profile of the person that users see in the application. For example, it is possible for a person object to exist in the system without a user attached to it in the cases where that person does not require access to the system. Similarly, it is possible to have a user without a profile in the system.

Set up

The following are one-off tasks required to carry out in order to set up your application.

  • create a custom control file used to read and process the messages you send to the application
  • create a new data import REST API, uploading the mentioned above control file
  • generate an API key, used to manage person objects
  • enable the user API and generate an API key for managing users

Initialising a user and their profile

1. Create the person’s object via the data import REST API
2. Create the user associated to that person by generating a message and including the ref returned by the message from step 1
3. (optional) If the user will be logging in via Haplo’s internal authentication system, you may wish to send the welcome link that can be returned by step 2’s message to the new user for them to set up their password

Updates

If the user’s name, email address, category, and/or status changes, both the user and the profile must be updated. The following steps can be taken in any order.

See the user REST API documentation for more information on the commands available.

Other details about the person, for example the research institute they belong to, only require updating the person’s object, and not the user attached to them.