• Home
  • Dynatrace API
  • Environment
  • Metric units
  • GET a unit

Metric units API - GET a unit

Gets properties of a metric unit.

The request produces an application/json payload.

GETManaged https://{your-domain}/e/{your-environment-id}/api/v2/units/{unitId}
SaaS https://{your-environment-id}.live.dynatrace.com/api/v2/units/{unitId}
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/v2/units/{unitId}

Authentication

To execute this request, you need an access token with Read metrics (metrics.read) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
unitIdstring

The ID of the required unit.

pathrequired

Response

Response codes

CodeTypeDescription
200Unit

Success

404-

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

Response body objects

The Unit object

The metadata of a unit.

ElementTypeDescription
unitIdstring

The ID of the unit.

displayNamestring

The display name of the unit.

Can be null.

symbolstring

The symbol of the unit.

Can be null.

descriptionstring

A short description of the unit.

Can be null.

displayNamePluralstring

The plural display name of the unit.

Can be null.

Response body JSON model

json
{ "unitId": "Second", "displayName": "second", "displayNamePlural": "seconds", "symbol": "s", "description": "The second is the base unit of time and defined as 1/86400 of a day." }

Example

In this example, the request retrieves metadata of the Ratio unit.

The API token is passed in the Authorization header.

Curl

bash
curl --request GET \ --url https://mySampleEnv.live.dynatrace.com//api/v2/units/MebiByte \ --header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

http
https://mySampleEnv.live.dynatrace.com//api/v2/units/MebiByte

Response body

json
{ "unitId": "MebiByte", "displayName": "mebibyte", "symbol": "MiB", "description": "1048576.0 byte" }

Response code

200