# 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/onpremise/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. ## Endpoints **GET** `/dcapi/target/{collectionId}/getTargets` ## Request URL `https://{server-hostname}:8383/dcapi/target/{collectionId}/getTargets` ## Scope `Configurations.READ` (or) `SWDeployment.READ` (or) `PatchMgmt.READ` (or) `VulnerabilityMgmt.READ` ## Header `Authorization: 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/onpremise/deployment-fw-get-configurations-view.html). ## Sample Request ```curl 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` - **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. ### 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. ### HTTP code 401 #### Response Body — application/json `JSON Object` - **errorCode** `long` Unauthorized error code returned when authentication credentials are missing, expired, or invalid (authentication=required) - **errorMsg** `string` Authentication failure reason ## Possible Response Codes - **200** `HTTP code` - **400** `HTTP code` - **401** `HTTP code` ## Sample Response: HTTP 200 ### 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" } } ``` ## Sample Response: HTTP 400 ### Collection is expired or no longer active ```json { "error_description": "Collection is not active or expired", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ## Sample Response: HTTP 401 ### 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" } ``` ## 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.