• Home
  • Dynatrace API
  • Environment
  • RUM
  • RUM JavaScript
  • GET inline code

RUM JavaScript API - GET inline code

Returns the inline code for the most recent OneAgent JavaScript. This is the complete configuration and monitoring code to be manually inserted into your web application code.

You can also use these functionally equivalent options to obtain the RUM JavaScript:

  • OneAgent JavaScript tag
  • JavaScript tag
  • Synchronous code snippet
  • Asynchronous code snippet

The request produces a text/plain payload.

GETManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v1/rum/jsInlineScript/{entity}
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v1/rum/jsInlineScript/{entity}
Environment ActiveGatehttps://{your-activegate-domain}/e/{your-environment-id}/api/v1/rum/jsInlineScript/{entity}

Authentication

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

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

Parameters

ParameterTypeDescriptionInRequired
entitystring

The Dynatrace entity ID of the application.

You can obtain it from the response of the GET the list of manually injected applications call.

pathrequired

Response

The response is a plain text, containing the inline HTML code for the most recent version of the OneAgent JavaScript tag for the specified application.

Example

In this example, the request fetches the inline HTML code for the latest version of the RUM JavaScript for the easyTravel Ionic Web application, which has the ID of APPLICATION-BBFA55551D507E2B.

The API token is passed in the Authorization header.

The result is truncated to the first line.

Curl

bash
curl -X GET \ https://mySampleEnv.live.dynatrace.com/api/v1/rum/jsInlineScript/APPLICATION-BBFA55551D507E2B \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/v1/rum/jsInlineScript/APPLICATION-BBFA55551D507E2B

Response body

plaintext
<script type="text/javascript"> <truncated> </script>

Response code

200