Get the React Native instrumentation snippets for a mobile frontend with the Dynatrace RUM API, with options for user opt-in and startup with Grail.
| GET | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/rum/v1/mobileConfigSnippets/reactNative/{id} |
You use the id path parameter, the Smartscape FRONTEND ID of a mobile frontend, to get the React Native instrumentation snippets for that app. Optional query parameters such as 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 |
| 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 | React | Success. The response contains the React Native mobile snippets. |
| 400 | Error | Bad request. |
| 404 | Error | Frontend not found. |
| 4XX | Error | Client error. |
| 5XX | Error | Server error. |
ReactNativeMobileConfigSnippetsDto objectMobile instrumentation snippets for the React Native platform.
| Element | Type | Description |
|---|---|---|
| downloadableConfig | string | The downloadable dynatrace.config.js file content. |
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 | - |
{"downloadableConfig": "string"}
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}