Skip to content

Basic Customer API

The basic API provides endpoints to search and fetch customer information, and should be used for all use cases except customer administration and management.

Tip

Use the Administrative Customer API for customer administration and management.

Fetching a customer

Fetching a single customer is done using the customer id or shortname

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "data": {
    "id": 0,
    "name": "string",
    "shortName": "string",
    "domain": {
      "id": 0,
      "name": "string"
    },
    "flags": [
      "disabled"
    ],
    "type": "GROUP"
  }
}

All endpoints for fetching, searching/listing, updating and disabling a customer return the same 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/customers/v2/customer/{idOrShortname}/logo?
includeDefault=true&size=sizeEnum

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/customers/v2/customer/{idOrShortname}
    /userroles" 

Fetching customer 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 descriptors.

1
2
3
4
5
curl -X 'GET' 
'https://api.mnemonic.no/customers/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'

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/customers/v2/customer?keywords=&parent=" 

Other parameters include limit, offset and sort.

Advanced search has access to all possible filtering parameters for customer, and f ollows 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/customers/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
9
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/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/customers/v2/domain?offset=0&limit=25"