Administration endpoints#

The administration endpoint are the ones found under useradmin/v2. The specific role required for each endpoint is different, but they should not be expected to be available for regular users.

Fetching a user#

Fetching a user can be done either by ID or short name(i.e. username):

curl -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/user/1

If successful, this query will return a user model:

{
  "data": {
    "id": 1,
    "shortName": "dennis",
    "name": "Dennis R Stevenson",
    "customer": {"id": 1, "shortName": "mnemonic"},
    ...
}

All endpoints for fetching, adding, searching/listing, updating and deleting a user return the same user datamodel.

Tip

See the Swagger API documentation for details on the returned data model.

Adding a user#

To create a user you need to provide customer(shortName or ID), a shortName and a name:

    curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" \
      https://api.mnemonic.no/useradmin/v2/user -d '
    { 
        "customer": "mnemonic", 
        "shortName": "dennis", 
        "name": "Dennis R Stevenson"
    }'

The newly created user is returned.

Updating a user#

Updating the fields of the user is done using a PUT request to the user resource.

To update a user you need the short name or ID, and to provide at least one field to update:

curl -X PUT -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" \
  https://api.mnemonic.no/useradmin/v2/user -d '
{ 
    "email": "dennis@example.com"
}'

The updated user is returned.

Disabling a user#

To disable a user you need the short name or ID of the user

curl -X DELETE -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/user/dennis

The disabled user is returned.

Reenabling a user#

To reenable a user you need the short name or ID of the user

curl -X PUT -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/user/dennis/reenable

The reenabled user is returned.

Unblocking a user#

If a used has too many failed logon attempts, the user is blocked.

Unblocking a user will allow that user to attempt to log in again. If the user has forgotten their password, it is possible to reset it

curl -X PUT -H "Argus-API-Key: my/api/key" \
  https://api.mnemonic.no/useradmin/v2/user/dennis/unblock

The unblocked user is returned.

Reset user password#

If a user has forgotten their password it is possible to reset it.

The reset password endpoint will reset the users password and email the new password to them.

curl -X PUT -H "Argus-API-Key: my/api/key" \
  https://api.mnemonic.no/useradmin/v2/user/dennis/resetpassword

List user permissions#

To see the permissions that have been granted to a user you need the name or ID of the user

curl -H "Argus-API-Key: my/api/key" \
  https://api.mnemonic.no/useradmin/v2/user/dennis/permissions

This returns a list of all the permissions that have been granted to the user.

Searching for users#

Searching for users can be done using the simple search GET endpoint or the advanced search POST endpoint.

Tip

Please read the general integration guide to learn about general concepts for search endpoints.

Administrating user preferences#

The user preferences store information about how the user has setup Argus(e.g. time zone and dashboard setting) as simple key/value pairs of text. It also contains some metadata about the user.

Listing out user preferences#

It is possible to list out all the preferences of a user using the ID or short name of the user

curl -H "Argus-API-Key: my/api/key" \
  https://api.mnemonic.no/useradmin/v2/user/dennis/preferences

This will return a list of user preference models

    {
      
      "data": {
        "key": "time.zone",
        "value": "Europe/Oslo",
          ...
    }

Tip

All endpoints for fetching, adding, listing, and deleting user preferences return the same user preference datamodel.

See the Swagger API documentation for details on the returned data model.

Adding or updating user preferences#

To add or update user preferences, use the PUT method to send a map with the new preferences

curl -X PUT -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" \
  https://api.mnemonic.no/useradmin/v2/user/dennis/preferences -d '
{ 
    "integration-guide.started": "true"
}'

This returns a list of the created or updated user preferences

Deleting user preferences#

To delete a user preference you send a DELETE request to the preferences endpoint

curl -X DELETE -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/user/dennis/preferences?key=time.zone&key=time.format.time

This returns a list of the deleted user preferences