# How to get key user action display name via API

**URL:** <https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723>\
**Category:** Real User Monitoring\
**Tags:** user-actions\
**Created:** [March 10, 2020, 3:27pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723 "2020-03-10T15:27:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [March 10, 2020, 3:27pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/1 "2020-03-10T15:27:14Z")

</div>

I’m trying to extract metrics for specific key user actions, via API calls such as the following. As can be seen, I am referencing the “entityID” of a specific key user action. I am trying to find a way, via the API, to lookup the display name of a Key User Action based on its ID but can’t find anyway to do this other than via USQL (sample query below). Perhaps I am overlooking something – is there in fact anyway to, via the API, get the display name for a specific entityID? Conversely, if I had a key user action name, would there be anyway of finding its entitityID via the API without using USQL?

API Example to get a metric for a specific key user action

https://\<ENV\>/api/v2/metrics/query?Api-Token=\<TOKEN\>&metricSelector=builtin:apps.web.action.duration.xhr.browser:merge(1)&entitySelector=type(APPLICATION\_METHOD),**entityId(APPLICATION\_METHOD-\<ID\>)**&resolution=M&from=now-12M

USQL sample:

select DISTINCT internalKeyUserActionId from useraction WHERE name = “loading of page /somepage/index.html”

---

<div class="post-metadata">

**Author:** ![Domenico\_Bressi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/domenico_bressi/32/7142_2.png) [@Domenico\_Bressi](https://community.dynatrace.com/u/Domenico_Bressi)\
**Post date:** [March 10, 2020, 10:38pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/2 "2020-03-10T22:38:21Z")

</div>

Hi [@Jeff R.](https://answers.dynatrace.com/users/4563/view.html)

I make yesterday something more or less similar using **Timeseries (Api V1)** to find “Key user actions”. I see you’re using V2 (metrics api)

try this to export all .. and/or … add parameter to export the one you need 🙂

[https://dynatrace.xxxxxx/e/xxxxxx/api/v1/timeseries/com.dynatrace.builtin:appmethod.useractionduration?includeData=true&aggregationType=AVG&relativeTime=day&queryMode=TOTAL](https://dynatrace.xxxxxx/e/xxxxxx/api/v1/timeseries/com.dynatrace.builtin:appmethod.useractionduration?includeData=true&aggregationType=AVG&relativeTime=day&queryMode=TOTAL)

 ![24112-1583879367196.png](https://global.discourse-cdn.com/dynatrace/original/2X/f/f80469c6344a293711d709ee67189091d5888553.png)

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [March 24, 2020, 5:04pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/3 "2020-03-24T17:04:27Z")

</div>

Thank you very much for suggesting this approach.

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [March 25, 2020, 6:22pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/4 "2020-03-25T18:22:12Z")

</div>

Unfortunately, after further investigation, I found that the solution provided above will not work. The V1 API is only usable for some metrics, and not the ones that relate to Key User Actions. E.g., you cannot lookup builtin:apps.web.action.duration.load.browser.

I could use the USQL API to obtain the display name for a Key User action based on its ID, but I would prefer not to take this approach because it would not allow me to lookup older key user action IDs (I believe that I would be restricted to 35 days worth of data).

I have been trying to find another way to get the display name via the API but so far without any success.

---

<div class="post-metadata">

**Author:** ![oakdag](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/oakdag/32/21850_2.png) [@oakdag](https://community.dynatrace.com/u/oakdag)\
**Post date:** [February 4, 2022, 1:04pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/5 "2022-02-04T13:04:41Z")

</div>

Hi Domenico,

How to get when we are using V2 (metrics api) ? Is it possible? Because we have to use v2 api.

Regards

---

<div class="post-metadata">

**Author:** ![mgome](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mgome](https://community.dynatrace.com/u/mgome)\
**Post date:** [February 4, 2022, 6:37pm UTC](https://community.dynatrace.com/t/how-to-get-key-user-action-display-name-via-api/18723/6 "2022-02-04T18:37:09Z")

</div>

You can use the /api/v2/entities API to get the display name of an APPLICATION\_METHOD entity.
