# Lifetime of data from Dynatrace API

**URL:** <https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295>\
**Category:** Real User Monitoring\
**Tags:** user-sessions, dynatrace-api\
**Created:** [January 25, 2019, 4:19pm UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295 "2019-01-25T16:19:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bastien\_tebbani](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@bastien\_tebbani](https://community.dynatrace.com/u/bastien_tebbani)\
**Post date:** [January 25, 2019, 4:19pm UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/1 "2019-01-25T16:19:39Z")

</div>

Hello,

I actually work with Dynatrace API and I have a little mistake. For each problem, I find when they start and end, afterward I apply a filter on userSession to find how many people are impact by a specific error.For some error, I don’t have any value in API response. However, when I search on Dynatrace website, I can find how many people are impact by this specific error. Therefore, I’m wondering if API and website have same data source, and if it’s not, how long API keep information and how to change that.

Thanks.

Regards,

Bastien T.

---

<div class="post-metadata">

**Author:** ![nj\_njoku](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nj_njoku/32/13710_2.png) [@nj\_njoku](https://community.dynatrace.com/u/nj_njoku)\
**Post date:** [January 25, 2019, 6:46pm UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/2 "2019-01-25T18:46:14Z")

</div>

Hi Bastien,

userSession is not a valid filter for getting the details of a problem via the Problems API. The only valid parameter is the **problemId.** Please see more on this [here](https://www.dynatrace.com/support/help/shortlink/api-problems#anchor_problem-details). Not everything available in the webUI is available in the Dynatrace API. See more on the Dynatrace API [here](https://www.dynatrace.com/support/help/dynatrace-api/).

Thanks

NJ

---

<div class="post-metadata">

**Author:** ![bastien\_tebbani](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@bastien\_tebbani](https://community.dynatrace.com/u/bastien_tebbani)\
**Post date:** [January 28, 2019, 8:39am UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/3 "2019-01-28T08:39:23Z")

</div>

Hello,

Why “Not everything available in the webUI is available in the Dynatrace API.” ? Where can I find datas available in the webUI and not in Dynatrace API ?

Thanks

Bastien T

---

<div class="post-metadata">

**Author:** ![bastien\_tebbani](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@bastien\_tebbani](https://community.dynatrace.com/u/bastien_tebbani)\
**Post date:** [January 29, 2019, 10:33am UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/4 "2019-01-29T10:33:13Z")

</div>

Or where can I find all data and why they are available in the webUI and not in Dynatrace API, they are differents sources of datas? All data from userSession are not in the same database if I want to have them from the webUI and Dynatrace API ?

Thanks.

Regards,

Bastien T.

---

<div class="post-metadata">

**Author:** ![nj\_njoku](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nj_njoku/32/13710_2.png) [@nj\_njoku](https://community.dynatrace.com/u/nj_njoku)\
**Post date:** [January 29, 2019, 2:35pm UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/5 "2019-01-29T14:35:07Z")

</div>

Hi Bastien,

See below for all the metrics that can be retrieved via the API

> **[Timeseries API v1](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/metric-v1)**
>
> Retrieve metric information via Timeseries v1 API.

All the various funtions the API can perform are listed in the link below

> **[Dynatrace API](https://docs.dynatrace.com/docs/dynatrace-api)**
>
> Find out what you need to use the Dynatrace API.

Thanks

NJ

---

<div class="post-metadata">

**Author:** ![bastien\_tebbani](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@bastien\_tebbani](https://community.dynatrace.com/u/bastien_tebbani)\
**Post date:** [January 30, 2019, 9:33am UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/6 "2019-01-30T09:33:38Z")

</div>

Hello [@Ugochukwu N.](https://answers.dynatrace.com/users/5446/view.html),

I’m sorry, you didn’t answer my question. I found how to use the Dynatrace API. My question was mainly about the lifetime of the data. I’m wondering about difference between the lifetime of the data in Dynatrace API and the lifetime of the data in webUI.

Do these data come from the same data source or are they in different databases with different data lifetimes?

Thanks.

Regards,

Bastien T.

---

<div class="post-metadata">

**Author:** ![nj\_njoku](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/nj_njoku/32/13710_2.png) [@nj\_njoku](https://community.dynatrace.com/u/nj_njoku)\
**Post date:** [January 30, 2019, 3:33pm UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/7 "2019-01-30T15:33:43Z")

</div>

Hi Bastien,

Timeseries metrics in the webUI and in the API have the same datasource and the same retention periods (see [here](https://www.dynatrace.com/support/help/shortlink/data-retention?_ga=2.96871638.814487925.1548658100-429664639.1535664430#timeseries-metrics)). Most timeseries metrics are exposed via the API (listed [here](https://www.dynatrace.com/support/help/dynatrace-api/environment/timeseries-api/#built-in-metrics) ). There are other data types in the Web UI that are not exposed via the API. See [here](https://www.dynatrace.com/support/help/shortlink/data-retention#data-retention-by-type)

Hope This Helps

NJ

---

<div class="post-metadata">

**Author:** ![bastien\_tebbani](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@bastien\_tebbani](https://community.dynatrace.com/u/bastien_tebbani)\
**Post date:** [January 31, 2019, 9:04am UTC](https://community.dynatrace.com/t/lifetime-of-data-from-dynatrace-api/19295/8 "2019-01-31T09:04:33Z")

</div>

Hi Ugochukwu,

It was exactly what I’m looking for! Thank you!

I had only a little question more:  
Did you know why my request didn’t return any data after few hours after end of an error?  
Here startDate is equal to the Timestamp in the begin of a specific error and endDate is the end of this specific error, applicationID is the ID of application receive with endDate and startDate when we interrogate Problem API . If data have a long duration of the lifetime, why evening I can’t get information of impact of a specific error which had takes place the morning of same date?

SELECT count(\*) as count, userAction.name as name, userAction.targetUrl as targetURL, applicationType, matchingConversionGoals , bounce, userAction.apdexCategory AS apdex

FROM userSession

WHERE totalErrorCount \> 0 and userType = “REAL\_USER”

AND userId = null

AND ((startTime \<= " + startDate + " AND endTime \>= " + endDate + ")

OR (startTime \<= " + startDate + " AND endTime \<= " + endDate + ")

OR (startTime \<= " + endDate + " AND startTime \>= " + startDate + " AND endTime \>= " + endDate + ")

OR (startTime \<= " + endDate + " AND startTime \>= " + startDate + " AND endTime \>= "+ startDate + " AND endTime \<= “+ endDate +”))

AND userAction.internalApplicationId=\" " + applicationID + " \"

GROUP BY userAction.name, userAction.targetUrl, applicationType, matchingConversionGoals, bounce, userAction.apdexCategory

ORDER BY count(\*) desc

Thanks.

Regards,

Bastien T.
