Real user monitoring JavaScript code management API

https://{id}.live.dynatrace.com/api/v1/rum/

The RUM JavaScript management API provides endpoints to help you set up and maintain your manually injected applications. You can fetch detailed information about your existing manually injected applications by calling the manualApps endpoint. The jsLatestVersion and appRevision endpoints deliver version information that indicates if the JavaScript code used in each of your manually injected applications is still up-to-date. Finally, the jsTag and jsInlineScript endpoints return the JavaScript code that you must insert into each of your applications’ pages to enable real user monitoring.

Manually injected applications information endpoint

https://{id}.live.dynatrace.com/api/v1/rum/manualApps

A call to the /rum/manualApps endpoint returns a list that contains detailed information about each of your manually injected applications.

Result

  • applicationId: The unique application ID generated by Dynatrace.
  • displayName: The name of the application assigned by the user.
  • monitoringEnabled: True if user monitoring is enabled, False if it isn’t monitored.
  • revision: Timestamp of the last application update.
  • deleted: True if the application has been deleted, False if it hasn’t been deleted.

The following code block shows an example result:

[{
	"applicationId": "APPLICATION-C15B48CBCADC863B",
	"displayName": "manually injected application",
	"monitoringEnabled": false,
	"revision": 1456380804910,
	"deleted": true
},
{
	"applicationId": "APPLICATION-920C704009D6D107",
	"displayName": "test",
	"monitoringEnabled": true,
	"revision": 1457360902690,
	"deleted": false
}]

Latest JavaScript code version endpoint

https://{id}.live.dynatrace.com/api/v1/rum/jsLatestVersion

A call to the /rum/jsLatestVersion endpoint returns the current real user monitoring JavaScript code version. The version is a natural number, a higher number indicates a newer version. If a newer version is available it’s recommended that you update the real user monitoring JavaScript code in each of your applications’ pages.

Result

10093160322132613

Current Application Revision endpoint

https://{id}.live.dynatrace.com/api/v1/rum/appRevision/{applicationid}

A call to the /rum/appRevision/{applicationId} endpoint returns the current application’s real user monitoring version. The version is a natural number; a higher number indicates a newer version. If a newer version is available it means that the configuration of your application has changed and you should update the real user monitoring JavaScript code in each of your applications’ pages.

The placeholder {applicationid} must be replaced with the actual unique application ID generated by Dynatrace. The application IDs of your manually injected applications can be found within the applicationId fields of each application listed in the manualApps-feed JSON result.

Result

1458693778941

JavaScript code endpoints

https://{id}.live.dynatrace.com/api/v1/rum/jsTag/{applicationid}
https://{id}.live.dynatrace.com/api/v1/rum/jsInlineScript/{applicationid}

You can use one of the two endpoints to fetch the JavaScript code from one of your manually injected applications. A call to the /rum/jsTag/{applicationid} endpoint returns an external JavaScript script tag, whereas a call to the /rum/jsInlineScript/{applicationid} endpoint returns an inline JavaScript script code. The external and inline versions of the JavaScript script tag are functionally equivalent. Note that the endpoints use the placeholder {applicationid} which must be replaced with the actual unique application ID generated by Dynatrace. The application IDs of your manually injected applications can be found within the applicationId fields of each application listed in the manualApps-feed JSON result.

Result

External JavaScript script tag:

<script type="text/javascript" src="https://js.dynatrace.com/jstag/1468ae7109d/ruxitagentjs_2fnqr_10093160322132613.js" data-dtconfig="app= C15B48CBCADC863B|cors=1|reportUrl=https://umsaywsjuo.dynatrace.com/bf|tp=500,50,0,1" crossorigin="anonymous"></script>