Skip to main content

addProductKey

This method adds a license or addon-key to the existing list of licenses and addon-keys.

Parameters

Parameter

Type

Optional

Description

licenseKey

String

No

The license key to be set. It can be an add-on or a base license.

companyId

String

Yes

The ID of the company whose license will be set. If no value is passed, the user's company will be selected.

replaceIncompatibleKeys

Boolean

Yes

If true, all existing base licenses or add-ons that are not compatible with the current license key will be removed and the new license will be added to the existing base licenses or add-on keys. The default value is true.

mdrContactInformation

Object

Yes

An object containing the company's designated emergency contact details, intended for use by the MDR team during security events or incidents.

Note

This information must be valid and it is mandatory for the following company types:

  • Any company with a yearly license that wants to enable the MDR service.

The object contains the following fields:

  • phoneNumber, an object containing the company's contact details needed to reach the organization by phone. I contains the following information:

    • countryPrefix, an integer containing the prefix for the country where the company is located.

      Note

      For countries that do not have a unique prefix, include the countryCode parameter as well.

      The following prefixes are shared by multiple countries: +1, +599, +39, +7, +39.

    • countryCode, a string representing the ISO 3166-1 alpha-2 code of the country where the company is located.

      Note

      This parameter should only be used instead of countryPrefix to identify the country when the company resides in a region that shares a telephone prefix with other countries.

    • subscriberNumber, a string representing the local portion of the company’s telephone number, excluding any country prefix or national dialing code.

  • fullName, a string containing the full name of the designated emergency contact person from the company.

  • email, a string containing the email address of the designated emergency contact person from the company.

  • emailVerificationCode, a string or numeric code used to verify ownership of the specified email address.

    Note

    You can get this code by using the generateEmailVerificationCode method.

  • useDataFromAccount - a string representing the ID of the GravityZone user account from which to import all relevant contact information, including the full name, email, and phone number.

    Note

    When this parameter is specified, it replaces phoneNumber, fullName, and email. These parameters are mutually exclusive with useDataFromAccount.

    If the specified user account has not been previously verified, emailVerificationCode must also be included in the request.

  • useDataFromCompany - a ring representing the ID of a GravityZone company account from which to import all relevant contact information, including the full name, email, and phone number.

    Note

    When this parameter is specified, it replaces phoneNumber, fullName, and email. These parameters, as well as emailVerificationCode, are mutually exclusive with useDataFromCompany.

Return value

This method does not return any value.

Example

Request:

Add a product key with manually specified MDR contact information.

{
  "params": {
    "licenseKey": "TNB3AAA",
    "companyId": "5493dcd2b1a43df00b7b23c6",
    "replaceIncompatibleKeys": true,
    "mdrContactInformation": {
      "phoneNumber": {
        "countryPrefix": "+4",
        "subscriberNumber": "112345"
      },
      "fullName": "Contact",
      "email": "[email protected]",
      "emailVerificationCode": "43728676"
    }
  },
  "jsonrpc": "2.0",
  "method": "addProductKey",
  "id": "48daf1bc-4078-411c-bf44-4f293e68f501"
}

Add a product key using MDR contact details imported from a user account.

{
  "params": {
    "licenseKey": "TNB3AAA",
    "companyId": "5493dcd2b1a43df00b7b23c6",
    "replaceIncompatibleKeys": true,
    "mdrContactInformation": {
      "useDataFromAccount": "user-1234567890",
      "emailVerificationCode": "43728676"
    }
  },
  "jsonrpc": "2.0",
  "method": "addProductKey",
  "id": "48daf1bc-4078-411c-bf44-4f293e68f501"
}

Add a product key using MDR contact details imported from a company account.

{
  "params": {
    "licenseKey": "TNB3AAA",
    "companyId": "5493dcd2b1a43df00b7b23c6",
    "replaceIncompatibleKeys": true,
    "mdrContactInformation": {
      "useDataFromCompany": "company-0987654321"
    }
  },
  "jsonrpc": "2.0",
  "method": "addProductKey",
  "id": "48daf1bc-4078-411c-bf44-4f293e68f501"
}

Response:

  {
        "id":"48daf1bc-4078-411c-bf44-4f293e68f501",
        "jsonrpc":"2.0",
        "result": null
}