Skip to content

Administrative Customer API

The administrative customer API is intended for customer administration and management. Some endpoints are overlapping the functionality of the basic API, but contains additional options and data which are available for administration.

Tip

Use the Basic Customer API for general search, autocompleters and other customer information to users.

Fetching a customer

Fetching a single customer is done using the customer id or shortname, same as in the Basic endpoint.

1
curl -H "Argus-API-Key: my/api/key" -X GET https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortname}

If successful, the above invocation will return the customer admin model:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  "data": [
    {
      "id": 0,
      "name": "string",
      "shortName": "string",
      "domain": {
        "id": 0,
        "name": "string"
      },
      "flags": [
        "disabled"
      ],
      "type": "group",
      "timeZone": {
        "description": "string"
      },
      "createdByUser": {
        "id": 0,
        "shortName": "string",
        "name": "string",
        "domain": {
          "id": 0,
          "name": "string"
        },
        "customer": {
          "id": 0,
          "name": "string",
          "shortName": "string",
          "domain": {
            "id": 0,
            "name": "string"
          }
        }
      },
      "createdTimestamp": 0,
      "lastUpdatedByUser": {
        "id": 0,
        "shortName": "string",
        "name": "string",
        "domain": {
          "id": 0,
          "name": "string"
        },
        "customer": {
          "id": 0,
          "name": "string",
          "shortName": "string",
          "domain": {
            "id": 0,
            "name": "string"
          }
        }
      },
      "lastUpdatedTimestamp": 0,
      "deletedTimestamp": 0,
      "deletedByUser": {
        "id": 0,
        "shortName": "string",
        "name": "string",
        "domain": {
          "id": 0,
          "name": "string"
        },
        "customer": {
          "id": 0,
          "name": "string",
          "shortName": "string",
          "domain": {
            "id": 0,
            "name": "string"
          }
        }
      },
      "language": "norwegian",
      "parent": {
        "id": 0,
        "name": "string",
        "shortName": "string",
        "domain": {
          "id": 0,
          "name": "string"
        }
      }
    }
  ]
}

All endpoints in the Admin API for fetching, searching/listing, updating and disabling a customer return the same Admin Customer datamodel.

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

To fetch customer logo it is enough to specify id or shortname, but additional options include logo size and if a default logo should be returned. This endpoint returns image in byte[] format with the mime type of the image in the response header.

1
2
curl -H "Argus-API-Key: my/api/key" -X GET https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortname}/logo?
includeDefault=true&size=sizeEnum

This endpoint updates customer's logo. If the logo provided is too large it will be resized, conserving the original ratio. Image string should contain only the data part in Base64 format, for example: 'data:image/png;base64, iVBORw0KGgoAAAA...', please provide only the 'iVBORw0KGgoAAAA...' part. Allowed mime types are: "image/png" and "image/jpeg". The endpoint returns the updated customer.

Note

The response model does not contain the logo.

1
2
3
4
5
6
7
8
9
curl -X 'PUT' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/logo?domain=domain' 
-H 'accept: application/json' 
-H 'Content-Type: application/json' 
-H 'Argus-API-Key: my/api/key'
-d '{
"image": "Base64string",
"mimeType": "string"
}'

Fetching customer user roles

This endpoint returns a list of customer roles. This endpoint is not yet populated with data.

1
2
    curl -H "Argus-API-Key: my/api/key" -X GET "https://api.mnemonic.no/customeradmin/v2/customer/
    {idOrShortname}/userroles" 

Searching for customers

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

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

For simple search it is possible to search for customers by keywords and filter out the results by parent id or shortname

1
curl -H "Argus-API-Key: my/api/key"  -X GET "https://api.mnemonic.no/customeradmin/v2/customer?keywords=&parent=" 

Other parameters include limit, offset and sort.

Advanced search has access to all possible filtering parameters for customer, and follows the general advanced search structure as described in the Overview.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customeradmin/v2/customer/search -d '{
  "customer":["shortname1", "2"],
  "parent":["1","shortname2"],
  "domain":["1", "otherDomain"],
  "includeDeleted":false,
  "includeFlags":[FlagEnumValue1, FlagEnumValue2],
  "excludeFlags":[FlagEnumValue3, FlagEnumValue4],
  "keywords":["keyword1","keyword2"],
  "keywordMatchStrategy":KeywordMatchStrategyEnumValue,
  "keywordFieldStrategy":[KeywordFieldStraregyEnumValue1, KeywordFieldStraregyEnumValue2],
  "subCriteria":[SearchBasicCustomerRequestSubCriteria1, SearchBasicCustomerRequestSubCriteria2],
  "limit":25,
  "offset":0,
  "sortBy":[SortBy1, SortBy2]
}'
See the Swagger API documentation for more details on valid request parameters.

Subcriteria

Subcriteria are discussed in detail in the General integration guide. We provide some examples related to the Customer API here, but the concepts for subcriteria are described more in detail there.

Using subcriteria allows you to fetch several different dimensions of data in one query, or express which data to exclude. By default, subqueries will be combined with an "OR" logic.

Subqueries with *exclude=true* define a set of criteria for cases to exclude:

1
2
3
4
5
6
7
8
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customeradmin/v2/customer/search -d  '{
  "parent":["mycustomerGroup1"],
  "includeFlags":["excludeFromProduction"],   
  "subCriteria": [
     {"includeFlags":["disabled","customerDataDeleted"],
      "exclude":false}
   ]
}'

Listing domains

This endpoint is located in a separate subsection of the API, called domain. It returns a list of domains limited by limit and offset:

1
curl -H "Argus-API-Key: my/api/key" -X GET "https://api.mnemonic.no/customeradmin/v2/domain?offset=0&limit=25" 

Creating new customer

This endpoint creates new customer in the system, based on a set of parameters. It returns the newly created customer. To create a customer group, please specify type group in the request. To create a non-group customer the type should be leaf.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
curl -X 'POST' 
  'https://api.mnemonic.no/customeradmin/v2/customer' 
  -H 'accept: application/json' 
  -H 'Content-Type: application/json' 
  -H 'Argus-API-Key: my/api/key' 
  -d '{
  "name": "string",
  "shortName": "string",
  "domain": "string",
  "parent": "string",
  "language": "norwegian",
  "timeZone": "string",
  "type": "group",
  "excludeFromProduction": true,
  "networkBaseCustomer": true,
  "singleNetworkDomain": true
}'

Updating customer

This endpoint allows to modify existing customer. It returns the updated customer. It's possible to change the following: - name - short name - language - timezone - setting for the following flags: - denySubmitForAnonymousUser - allowGlobalData - excludeFromProduction - networkBaseCustomer - singleNetworkDomain - dataDeleted

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
curl -X 'PUT' 
  'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}?domain=domain' 
  -H 'accept: application/json' 
  -H 'Content-Type: application/json' 
  -H 'Argus-API-Key: my/api/key'
  -d '{
  "name": "string",
  "shortName": "string",
  "language": "norwegian",
  "timeZone": "string",
  "denySubmitForAnonymousUser": true,
  "allowGlobalData": true,
  "excludeFromProduction": true,
  "networkBaseCustomer": true,
  "singleNetworkDomain": true,
  "dataDeleted": true
}'

Disabling customer

This endpoint allows to disable customer, it should be used after customer data is deleted. The flag Disabled is set on the customer object, but it remains in our db for reference purposes. The disabled customer will no longer show up in searches, unless specifically requested. Only admins that have access privileges for the customer's parent will be able to view it.

1
2
3
4
curl -X 'PUT' 
  'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}?domain=domain' 
  -H 'accept: application/json' 
  -H 'Argus-API-Key: my/api/key'

Re-enabling customer

This endpoint allows reenabling a disabled customer.

1
2
3
4
curl -X 'PUT' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/reenable?domain=domain' 
-H 'accept: application/json' 
-H 'Argus-API-Key: my/api/key'

Pruning customer data

Use this endpoint to trigger pruning of the customer data in Argus.

Note: This endpoint requires special authorization for the 'pruneCustomerData' operation.

1
2
3
4
curl -X 'DELETE' 
'https://api.mnemonic.no/customers/v2/customer/idOrShortName/data?domain=domain%20&token=authorizationToken' 
-H 'accept: application/json' 
-H 'Argus-API-Key: my/api/key'

Moving customer

This endpoint allows the admins to change the parent of the customer. The new parent has to be of group type, and the move should not grant any additional privileges to new users.

1
2
3
4
5
6
7
8
curl -X 'PUT' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/move?domain=domain' 
-H 'accept: application/json' 
-H 'Content-Type: application/json' 
-H 'Argus-API-Key: my/api/key'
-d '{
"parent": "string"
}'

Fetching properties

This endpoint returns a list of properties limited by limit and offset. The list can be filtered by property keys. The list includes default values from the descriptor.

1
2
3
4
5
curl -X 'GET' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/properties?
domain=domain%20&name=key1&name=key2&includeUnset=false&offset=0&limit=25' 
-H 'accept: application/json' 
-H 'Argus-API-Key: my/api/key'

Updating properties

This endpoint allows updating existing customer properties or adding new ones. Inserted values are validated against the descriptor and accepted only if they are of correct type and have the proper format. It is not possible to update a property that has no descriptor set up.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl -X 'PUT' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/properties?domain=domain' 
-H 'accept: application/json' 
-H 'Content-Type: application/json' 
-H 'Argus-API-Key: my/api/key'
-d '{
"properties": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
}'

Deleting properties

This endpoint allows the user to reset properties to property descriptor's default.

1
2
3
4
curl -X 'DELETE' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/properties?domain=domain&key=key1&key=key2' 
-H 'accept: application/json' 
-H 'Argus-API-Key: my/api/key'

Updating user roles

To update customer user roles you need to provide which role to update and which user (id or shortname) should be responsible.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
curl -X 'PUT' 
'https://api.mnemonic.no/customeradmin/v2/customer/{idOrShortName}/userroles?domain=domain' 
-H 'accept: application/json' 
-H 'Content-Type: application/json' 
-H 'Argus-API-Key: my/api/key'
-d '{
"userRoles": [
{
"role": "technicalAccountManager",
"user": "idOrShortName"
}
]
}'