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.
| GET | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/rum/v1/mobileConfigSnippets/android/{id} |
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.
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.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| id | string | Smartscape FRONTEND id. | path | Required |
| sessionReplay | boolean | Enables or disables Session Replay. If specified, this overrides the configured value. | query | Optional |
| userOptIn | boolean | Enables or disables user opt-in mode. If specified, this overrides the configured value. | query | Optional |
| startupWithGrail | boolean | Enables or disables startup with Grail. If specified, this overrides the configured value. | query | Optional |
| Code | Type | Description |
|---|---|---|
| 200 | Android | Success. The response contains the Android mobile snippets. |
| 400 | Error | Bad request. |
| 404 | Error | Frontend not found. |
| 4XX | Error | Client error. |
| 5XX | Error | Server error. |
AndroidMobileConfigSnippetsDto objectMobile instrumentation snippets for the Android platform.
| Element | Type | Description |
|---|---|---|
| applyPluginGroovy | string | The Dynatrace plugin configuration to apply in the app build script (Groovy DSL). |
| applyPluginKotlin | string | The Dynatrace plugin configuration to apply in the app build script (Kotlin DSL). |
| optInJava | string | The user opt-in privacy configuration code (Java). |
| optInKotlin | string | The user opt-in privacy configuration code (Kotlin). |
ErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code |
| constraintViolations | Constraint | A list of constraint violations |
| message | string | The error message |
ConstraintViolation objectA list of constraint violations
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"applyPluginGroovy": "string","applyPluginKotlin": "string","optInJava": "string","optInKotlin": "string"}
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}