Try it free

Get the Android instrumentation snippets

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026
  • Early Access

Get the Android instrumentation snippets for a mobile frontend with the Dynatrace RUM API, with options for Session Replay, user opt-in, and Grail startup.

GETSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/rum/v1/mobileConfigSnippets/android/{id}

Overview

You use the id path parameter, the Smartscape FRONTEND ID of a mobile frontend, to get the Android instrumentation snippets for that app. Optional query parameters such as sessionReplay, userOptIn, and startupWithGrail override the configured settings for the generated snippets. A 200 response returns the snippets to add to your app.

Authentication

To execute this request, you need a platform token or OAuth access token with rum:mobile-config-snippets:read scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
idstring

Smartscape FRONTEND id.

pathRequired
sessionReplayboolean

Enables or disables Session Replay. If specified, this overrides the configured value.

queryOptional
userOptInboolean

Enables or disables user opt-in mode. If specified, this overrides the configured value.

queryOptional
startupWithGrailboolean

Enables or disables startup with Grail. If specified, this overrides the configured value.

queryOptional

Response

Response codes

CodeTypeDescription
200AndroidMobileConfigSnippetsDto

Success. The response contains the Android mobile snippets.

400ErrorEnvelope

Bad request.

404ErrorEnvelope

Frontend not found.

4XXErrorEnvelope

Client error.

5XXErrorEnvelope

Server error.

Response body objects

The AndroidMobileConfigSnippetsDto object

Mobile instrumentation snippets for the Android platform.

ElementTypeDescription
applyPluginGroovystring

The Dynatrace plugin configuration to apply in the app build script (Groovy DSL).

applyPluginKotlinstring

The Dynatrace plugin configuration to apply in the app build script (Kotlin DSL).

optInJavastring

The user opt-in privacy configuration code (Java).

optInKotlinstring

The user opt-in privacy configuration code (Kotlin).

The ErrorEnvelope object

ElementTypeDescription
errorError-

The Error object

ElementTypeDescription
codeinteger

The HTTP status code

constraintViolationsConstraintViolation[]

A list of constraint violations

messagestring

The error message

The ConstraintViolation object

A list of constraint violations

ElementTypeDescription
locationstring-
messagestring-
parameterLocationstring-
The element can hold these values
  • HEADER
  • PATH
  • PAYLOAD_BODY
  • QUERY
pathstring-

Response body JSON models

{
"applyPluginGroovy": "string",
"applyPluginKotlin": "string",
"optInJava": "string",
"optInKotlin": "string"
}
{
"error": {
"code": 1,
"constraintViolations": [
{
"location": "string",
"message": "string",
"parameterLocation": "HEADER",
"path": "string"
}
],
"message": "string"
}
}
Related tags
Platform APIDynatrace Platform