# Get current targets as resource IDs 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](https://www.manageengine.com/products/desktop-central/help/api/cloud/deployment-fw-modify-targets-new.html) endpoint — making it easy to fetch, modify, and resubmit targets without format conversion. To use this format, pass `useResourceIdFormat=true` as a query parameter. ## Endpoint `GET /dcapi/target/{collectionId}/getTargets` ## Request ### Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/dcapi/target/{collectionId}/getTargets` ### Scope `DesktopCentralCloud.Configurations.READ`, `DesktopCentralCloud.SWDeployment.READ`, `DesktopCentralCloud.PatchMgmt.READ`, `DesktopCentralCloud.VulnerabilityMgmt.READ` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **Accept** (`string`, Mandatory): `application/getTargets.v1+json` #### Path Parameters - **collectionId** (`string`, Mandatory): The unique numeric identifier of the collection whose targets are to be retrieved. Fetch from [Get Configurations View](https://www.manageengine.com/products/desktop-central/help/api/cloud/deployment-fw-get-configurations-view.html). #### Query Parameters - **useResourceIdFormat** (`boolean`, Mandatory): Set to true to receive the Resource-ID format response containing numeric resource IDs. Omit or set false for the domain/value pairs format. ### Sample Request ```curl curl --request GET \ --url 'https://appdomains/dcapi/target/{collectionId}/getTargets?useResourceIdFormat=SOME_BOOLEAN_VALUE' \ --header 'Accept: application/getTargets.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' ``` ## Response ### HTTP Code 200 #### Response Body: `application/json` - JSON Object - **collectionId** (`long`): Unique collection ID whose targets are returned. - **targetDetails** (`JSON Object`): Target descriptor in Resource ID format containing the target type and an array of numeric resource IDs. #### Sample Response Computer-type collection with three targeted resources (Resource ID format): ```json { "collectionId": 12345, "targetDetails": { "values": [ 1001, 1002, 1003 ], "type": "computer" } } ``` User-type collection with two targeted user resources (Resource ID format): ```json { "collectionId": 67890, "targetDetails": { "values": [ 2001, 2002 ], "type": "user" } } ``` ### HTTP Code 400 #### Response Body: `application/json` - JSON Object - **error_code** (`string`): `CONFIG_INVALID_INPUT_DATA`: the specified collection is expired or no longer alive. - **error_description** (`string`): Message indicating the collection is not active or has expired. #### Sample Response Collection is expired or no longer active: ```json { "error_description": "Collection is not active or expired", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ### HTTP Code 401 #### Response Body: `application/json` - JSON Object - **errorCode** (`long`): Unauthorized error code: credentials missing, expired, or invalid. - **errorMsg** (`string`): Authentication failure reason. #### Sample Response User lacks read role for this configuration type: ```json { "error_description": "Access denied - You are not allowed to access the requested resource.", "error_code": "UAC_UNAUTHORIZED" } ``` ### Possible Response Codes - **200** — HTTP code - **400** — HTTP code - **401** — HTTP code ## Rate Limit ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **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.