• Home
  • Dynatrace API
  • Environment
  • Metric units
  • GET convert units

Metric units API - GET convert units

Converts a source unit into a target unit.

If no target unit is set, the request finds an appropriate target unit automatically, taking into account the preferred number format (if specified).

The request produces an application/json payload.

GETManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/units/{unitId}/convert
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/units/{unitId}/convert
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v2/units/{unitId}/convert

Authentication

To execute this request, you need an access token with metrics.read scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
unitIdstring

The ID of the source unit.

pathrequired
valuenumber

The value to be converted.

queryrequired
targetUnitstring

The ID of the target unit.

queryoptional
numberFormatstring

The preferred number format. Only taken into account if no target unit is specified.

queryoptional

Response

Response codes

CodeTypeDescription
200UnitConversionResult

Success

404

Not found. The requested resource is not found or the query is incorrect.

Response body objects

The UnitConversionResult object

The result of a unit conversion.

ElementTypeDescription
unitIdstring

The ID of the unit of this conversion result.

resultValuenumber

The result of the unit conversion.

Response body JSON model

json
{ "unitId": "string", "resultValue": 1 }