Customer Contacts Integration Guide#

Customer contacts is a legacy concept for which users and/or email/SMS destinations should be notified for cases of different services, types and priorities.

Tip

Customer Contacts is a deprecated concept, which will be replaced by Case Default Watchers. The responsibility for the new concept will be in the Case service, see Case Integration Guide.

Once implementation of this new concept start, this guide will contain references and migration guides to move to the new concept.

Listing customer contacts#

Listing customer contacts can be done using

curl -H "Argus-API-Key: my/api/key" -X GET https://api.mnemonic.no/customers/v2/contact?customer=mycustomer

Response

{
  "data": [
    {
      "id": 5,
      "name": "My User",
      "description": "Some description",
      "email": "myuser@domain.com",
      "mobilePhone": "4799887766",
      "language": "english",
      "customer": {
      },
      "user": {
        "id": 0,
        "userName": "myuser"
      },
      "flags": [],
      "services": [
        {
          "id": 2,
          "localizedName": "Security Monitoring",
          "name": "Security Monitoring",
          "shortName": "ids"
        }
      ],
      "mailSettings": {
        "action": [
          "createCase",
          "updateCase"
        ],
        "caseType": [
          "securityIncident"
        ],
        "priority": [
          "medium",
          "high"
        ],
        "verbose": true
      },
      "smsSettings": {
        "action": [
          "createCase"
        ],
        "caseType": [
          "securityIncident"
        ],
        "priority": [
          "high"
        ],
        "verbose": false
      }
    }
  ]
}

The query parameters can be used to filter which contacts to fetch.

Tip

The Swagger API documentation is always up-to-date and lets you try out any query with your user session or an API-key.

The returned contact contains a description, email and/or sms information, the customer which the contact is bound to, as well as settings for both email and SMS notification, stating under which conditions the contact should be notified.

The “user” object is filled out if the contact is linked to a user. If so, the email/sms of the contact will always be the same as that of the user. For non-user contacts, the email/sms can be set freely.

The list of services specifies which case services this contact is valid for.

Tip

This endpoint will be replaced by the Case service endpoint /cases/v2/defaultwatcher. See Swagger API documentation.

When is the contact notified?#

The Case service will lookup customer contacts when creating, updating or closing a case, only if the case is non-restricted, and where default contacts is enabled. The service will fetch contacts which:

  • belong to the same customer as the case

  • is valid for the service that the case is bound to

For each matching contact, the case service will check both email and SMS settings. If the settings are enabled, and matches the case type, priority and the action performed, the case service will include this contact when notifying (for either type email or SMS)

If the “verbose” flag of the email settings are set, the case service will issue a “verbose” email notification. See Notification Service for more details on notification, Notification Integration Guide.

Fetching a specific contact#

To fetch a single contact:

curl -X GET -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/v1/contact/1234 

Creating a new customer contact#

To define a new customer contact, either create a contact bound to a user:

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/v1/contact 
-d  '{
  "customer":"mycustomer",   
  "user":"myuser",   
  "services":["ids"],   
  "mailSettings":{
    "action":["createCase"],
    "priority":["high"],
  }   
}'

Or, create a direct contact not bound to a user:

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/v1/contact 
-d  '{
  "name":"Some name",
  "email": "mailbox@somewhere.com",
  "language":"english",   
  "services":["ids"],   
  "mailSettings":{
    "action":["createCase"],
    "priority":["high"],
  }   
}'

Tip

See the Swagger API documentation for more details on valid request parameters.

Adding/removing services from a contact#

To add a service to the list of active services for a contact:

curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/v1/contact/1234/services 
-d  '{
  "service":"support"
}'

To remove a service from a contact:

curl -X DELETE -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json"  https://api.mnemonic.no/customers/v1/contact/1234/services/support