Get current targets as resource IDs

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

Returns the current targets of a collection, configuration as an array of numeric resource IDs.The response format matches the input expected by the modifyTargets endpoint — making it easy to fetch, modify, and resubmit targets without format conversion.To use this format, pass useResourceIdFormat=true as a query parameter.

Request URL

https://{server-hostname}:8383/dcapi/target/{collectionId}/getTargets

Scope

Configurations.READCopied!
(or)
SWDeployment.READCopied!
(or)
PatchMgmt.READCopied!
(or)
VulnerabilityMgmt.READCopied!

Header

Authorization: d92d4xxxxxxxxxxxxx15f52

Request Parameters

- Request Headers

AcceptstringMandatory
application/getTargets.v1+jsonapplication/getTargets.v1+jsonCopied!

- Path Parameters

collectionIdstringMandatory

The unique numeric identifier of the collection whose targets are to be retrieved. Fetch from Get Configurations View .

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request GET \
  --url https://appdomain/dcapi/target/{collectionId}/getTargets \
  --header 'Accept: application/getTargets.v1+json' \
  --header 'Authorization:  d92d4xxxxxxxxxxxxx15f52'

Response Parameters

- HTTP code 200

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

Unique collection ID whose targets are returned.

targetDetailsJSON Object

Target descriptor in Resource ID format containing the target type and an array of numeric resource IDs.

Show Sub-Attributes
typestring

Target category — 'computer' for computer-based collections, 'user' for user-based collections.

valuesarray

Array of numeric resource IDs currently targeted by the collection. Only actively managed resources (MANAGED_BY_DC) are included for computer-type collections.

- HTTP code 400

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

CONFIG_INVALID_INPUT_DATA: the specified collection is expired or no longer alive.

error_descriptionstring

Message indicating the collection is not active or has expired.

- HTTP code 401

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

Unauthorized error code returned when authentication credentials are missing, expired, or invalid (authentication=required)

errorMsgstring

Authentication failure reason

Possible Response Codes

200HTTP code
400HTTP code
401HTTP code

Sample Response: HTTP 200

Computer-type collection with three targeted resources (Resource ID format)

Copied!
  {
    "collectionId": 12345,
    "targetDetails": {
      "values": [
        1001,
        1002,
        1003
      ],
      "type": "computer"
    }
  }
                
Show full

User-type collection with two targeted user resources (Resource ID format)

Copied!
  {
    "collectionId": 67890,
    "targetDetails": {
      "values": [
        2001,
        2002
      ],
      "type": "user"
    }
  }
                
Show full

Sample Response: HTTP 400

Collection is expired or no longer active

Copied!
  {
    "error_description": "Collection is not active or expired",
    "error_code": "CONFIG_INVALID_INPUT_DATA"
  }
                
Show full

Sample Response: HTTP 401

User lacks read role for this configuration type

Copied!
  {
    "error_description": "Access denied - You are not allowed to access the requested resource.",
    "error_code": "UAC_UNAUTHORIZED"
  }
                
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.