Skip to content

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):

1
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:

1
2
3
4
5
6
7
8
{
  "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:

1
2
3
4
5
6
7
    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:

1
2
3
4
5
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

1
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

1
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

1
2
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.

1
2
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

1
2
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.

For simple search, the valid filtering parameters can be added as query parameters, which will ANDed together for each parameter.

If any parameter name is repeated, all the values for that parameter name will be combined according to the Swagger API documentation

Providing no parameters will return all users.

1
2
3
# search for users belonging to mnemonic matching the keyword "Stevenson" 
curl -H "Argus-API-Key: my/api/key" \
   https://api.mnemonic.no/useradmin/v2/user?customer=Mnemonic&keyword=stevenson

The result will be a list of all users the current user has access to matching the query.

Advanced searches allow combining multiple queries to get more fine-grained searches.

Detailed information on how to build advanced searches using sub-criteria are found in the general integration guide.

All parameters available for user search are detailed in the Swagger API documentation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# search for users that are either deleted or blocked 
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" \
  https://api.mnemonic.no/useradmin/v2/user/search -d '
{ 
  "includeDeleted": true, 
  "subCriteria": [
    { "includeFlags": ["deleted"] }, 
    { "includeFlags": ["blocked"] }
  ] 
}'

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

1
2
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

1
2
3
4
5
6
7
    {

      "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

1
2
3
4
5
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

1
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