Group administration#

Fetching a group#

Fetching a group 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/group/2

If successful, this query will return a group model:

{
  "data": {
    "id": 2,
    "shortName": "mnemonic-developers", 
    "name": "Mnemonic developer users"
    "customer": {"id": 1, "shortName": "Mnemonic"}
    ...
}

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

Tip

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

Adding a group#

To create a group 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/group -d '
{ 
    "customer": "mnemonic", 
    "shortName": "mnemonic-developers", 
    "name": "Mnemonic developer users"
}'

The newly created user is returned

Updating a group#

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

To update a group 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/group -d '
{ 
    "name": "Mnemonic developers"
}'

The updated group is returned

Disabling a group#

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

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

The disabled group is returned

Reenabeling a group#

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

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

The reenabled group is returned

Listing group members#

To list the members of a group you need the ID or short name of the group

curl -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/group/mnemonic-developers/members

This will return a list of the members of the group, which can be either users or groups.

Adding members to a group#

If you want to add members to a group you need to know the short name or ID of the group you are adding them to, as well as the short name or ID of the subjects( users or groups) that you want to add as members

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" \
  https://api.mnemonic.no/useradmin/v2/group/mnemonic-developers/members -d '
{ 
    "subject": ["dennis", 1234]
}'

The subjects added to the group are returned

Removing members from a group#

If you want to remove members from a group you need to know the short name or ID of the group you are removing them from, as well as the short name or ID of the subjects( users or groups) that you want to remove as members

curl -X DELETE -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/group/mnemonic-developers/members?subject=dennis

The removed subjects are returned

List group permissions#

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

curl -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/useradmin/v2/group/mnemonic-developers/permissions

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

Searching for groups#

Searching for groups 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.