Create up to 500 software metering rules in a single request

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Allows you to add multiple software metering rules at once (up to 500). Each rule is processed individually — successfully created rules are saved, while any that fail validation are reported back with the reason for failure.

Request URL

https://{server-hostname}:8383/dcapi/inventory/software/metering/bulk

Scope

Inventory.CREATECopied!

Header

Authorization: d92d4xxxxxxxxxxxxx15f52

Request Parameters

- Request Headers

AcceptstringMandatory
application/bulkRuleAddStatus.v1+jsonapplication/bulkRuleAddStatus.v1+jsonCopied!
Content-TypestringMandatory
application/bulkAddMeteringRules.v1+jsonapplication/bulkAddMeteringRules.v1+jsonCopied!

- Request Body

application/json
JSON Object
Hide Sub-Attributes
rulesJSON ArrayMandatory
Show Sub-Attributes
JSON Object
Show Sub-Attributes
softwareIDlongMandatory
osPlatformintegerMandatory
ruleNamestringMandatory
fileNamestringMandatory
originalFileNamestringOptional
fileVersionstringOptional
productNamestringOptional
commentsstringOptional

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request POST \
  --url https://appdomain/dcapi/inventory/software/metering/bulk \
  --header 'Accept: application/bulkRuleAddStatus.v1+json' \
  --header 'Authorization:  d92d4xxxxxxxxxxxxx15f52' \
  --header 'Content-Type: application/bulkAddMeteringRules.v1+json' \
  --data '{"rules":[{"softwareID":0,"osPlatform":0,"ruleName":"string","fileName":"string","originalFileName":"string","fileVersion":"string","productName":"string","comments":"string"}]}'

Sample Request Body

Copied!
  {
    "rules": [
      {
        "softwareID": 0,
        "osPlatform": 0,
        "ruleName": "string",
        "fileName": "string",
        "originalFileName": "string",
        "fileVersion": "string",
        "productName": "string",
        "comments": "string"
      }
    ]
  }
                
Show full

Response Parameters

- HTTP code 200

Response Body - application/json
JSON Object
Hide Sub-Attributes
statusstring

Overall outcome - SUCCESS (all entries inserted), PARTIAL_SUCCESS (mix of inserted and failed) or FAILURE (zero inserted)

summaryJSON Object

Counts: totalRequested, successCount, failedCount

Show Sub-Attributes
succeededarray

Entries inserted successfully. Each item carries softwareID, osPlatform, ruleName and the generated appDefinitionID

failedarray

Entries rejected by validation or DB write (including duplicate rule names). Each item carries errorCode, errorMessage and the original input object echoed back

- HTTP code 400

Response Body - application/json
JSON Object
Hide Sub-Attributes
error_codestring

CUSTOMER_HEADER_MISSING - MSP environment requires X-Customer header

error_descriptionstring

Missing customer header error message

- HTTP code 401

Response Body - application/json
JSON Object
Hide Sub-Attributes
error_codestring

UAC_UNAUTHORIZED - user lacks the required uem-roles or credentials are missing

error_descriptionstring

Authentication or authorization failure reason

- HTTP code 500

Response Body - application/json
JSON Object
Hide Sub-Attributes
error_codestring

INTERNAL_ERROR - unexpected exception in the service layer

error_descriptionstring

Internal server error message

Possible Response Codes

200HTTP code
400HTTP code
401HTTP code
500HTTP code

Sample Response: HTTP 200

Mixed bulk add outcome

Copied!
  {
    "summary": {
      "failedCount": 2,
      "successCount": 1,
      "totalRequested": 3
    },
    "failed": [
      {
        "input": {
          "originalFileName": "Google Chrome.app",
          "fileName": "Google Chrome",
          "softwareID": 67890,
          "comments": "Track Chrome on Mac",
          "ruleName": "Chrome - Mac",
          "osPlatform": 2,
          "fileVersion": "",
          "productName": "Google Chrome"
        },
        "errorMessage": "ruleName 'Chrome - Mac' is already in use",
        "errorCode": "DUPLICATE_RULE_NAME"
      },
      {
        "input": {
          "originalFileName": "notepad++.exe",
          "fileName": "notepad++.exe",
          "softwareID": 789,
          "comments": "",
          "ruleName": "Notepad++ - Windows",
          "osPlatform": 1,
          "fileVersion": "",
          "productName": "Notepad++"
        },
        "errorMessage": "Software 789 is not detected on osPlatform 1",
        "errorCode": "OS_PLATFORM_MISMATCH"
      }
    ],
    "status": "PARTIAL_SUCCESS",
    "succeeded": [
      {
        "softwareID": 67890,
        "appDefinitionID": 9001,
        "ruleName": "Chrome - Windows",
        "osPlatform": 1
      }
    ]
  }
                
Show full

Sample Response: HTTP 400

rules array missing, empty or above 500

Copied!
  {
    "error_description": "rules array is required and must contain 1-500 entries",
    "error_code": "INVALID_DATA"
  }
                
Show full

Sample Response: HTTP 401

Caller lacks Inventory_Admin role

Copied!
  {
    "error_description": "Unauthorized access",
    "error_code": "UAC_UNAUTHORIZED"
  }
                
Show full

Sample Response: HTTP 500

Server error

Copied!
  {
    "error_description": "Internal server error",
    "error_code": "INTERNAL_ERROR"
  }
                
Show full

Duration: 1 minute | Threshold: 30 | Lock period: 5 minutes

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.