Get current targets as domain and value pairs

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 domain and value pairs.The response format matches the input expected by the modifyTargets endpoint — making it easy to fetch, modify, and resubmit targets without format conversion.This is the default format. No additional query parameters are needed. omit useResourceIdFormat or set it to false.

Request URL

https://{serverurl}/dcapi/target/{collectionId}/getTargets

Scope

DesktopCentralCloud.Configurations.READDesktopCentralCloud.SWDeployment.READDesktopCentralCloud.PatchMgmt.READDesktopCentralCloud.VulnerabilityMgmt.READCopied!

Header

Authorization: Zoho-oauthtoken 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 .

- Query Parameters

useResourceIdFormatbooleanOptional

Omit or set to false to receive the domain/value pairs response format.

Sample Request

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

Response Parameters

- HTTP code 200

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

Unique collection ID whose targets are returned.

targetsJSON Array

Array containing a single filter entry. Each entry holds a filter object with the target type and an array of name/domain pairs identifying targeted resources.

Show Sub-Attributes
JSON Object
Show Sub-Attributes
filterJSON Object

Filter descriptor identifying the target type and the list of resource name/domain pairs.

Show Sub-Attributes
typestring

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

valuesJSON Array

Array of name/domain pair objects identifying each targeted resource.

Show Sub-Attributes
JSON Object
Show Sub-Attributes
valuestring

NetBIOS computer name or username of the targeted resource.

domainstring

Active Directory domain or workgroup the targeted resource belongs to.

- 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: credentials missing, expired, or invalid

errorMsgstring

Authentication failure reason

Possible Response Codes

200HTTP code
400HTTP code
401HTTP code

Sample Response: HTTP 200

Computer-type collection with two targeted computers (domain and value format)

Copied!
  {
    "collectionId": 12345,
    "targets": [
      {
        "filter": {
          "values": [
            {
              "domain": "CORP",
              "value": "PC-001"
            },
            {
              "domain": "CORP",
              "value": "LAPTOP-DEF"
            }
          ],
          "type": "Computer"
        }
      }
    ]
  }
                
Show full

User-type collection with one targeted user (domain and value format)

Copied!
  {
    "collectionId": 67890,
    "targets": [
      {
        "filter": {
          "values": [
            {
              "domain": "CORP",
              "value": "jdoe"
            }
          ],
          "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.