# Dynatrace Synthetic Monitoring credentials using PAM api

**URL:** <https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788>\
**Category:** Synthetic Monitoring\
**Tags:** synthetic-monitoring\
**Created:** [March 15, 2021, 3:02pm UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788 "2021-03-15T15:02:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordan\_rose](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jordan\_rose](https://community.dynatrace.com/u/jordan_rose)\
**Post date:** [March 15, 2021, 3:02pm UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788/1 "2021-03-15T15:02:05Z")

</div>

Is there any way for Synthetic Monitoring transactions to call the CA PAM api to get a user account/credentials?

Our security team is pushing for a “check in/check out” process for certain service accounts. If we could call the PAM api to get the account and credentials this would satisfy that need.

---

<div class="post-metadata">

**Author:** ![Philipp\_Kastner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/philipp_kastner/32/28797_2.png) [@Philipp\_Kastner](https://community.dynatrace.com/u/Philipp_Kastner)\
**Post date:** [March 18, 2021, 9:02pm UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788/2 "2021-03-18T21:02:18Z")

</div>

Hi&nbsp;[@jordan\_rose](https://community.dynatrace.com/user/26207),

are you using browser monitors? If yes, you can use a [JavaScript event](https://www.dynatrace.com/support/help/shortlink/id_brower-clickpath-events#javascript-) to execute simple API calls.  
Similar to the example shown in the help

 ![Philipp_Kastner_0-1616101294887.png](https://global.discourse-cdn.com/dynatrace/original/2X/3/33c337b77bb7580b823cacbf2cfafad92a99f26f.png)

Hope this helps,

Philipp

---

<div class="post-metadata">

**Author:** ![jordan\_rose](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jordan\_rose](https://community.dynatrace.com/u/jordan_rose)\
**Post date:** [March 18, 2021, 10:11pm UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788/3 "2021-03-18T22:11:00Z")

</div>

Hi Philipp, thanks for the reply and this is very helpful. Once I retrieve a user name how can I set it to a variable and input that into a form field. I looked through the doc and didn’t see this and I haven’t had any need to edit the scripts of the recorded click path yet so forgive me if I’m missing it.

Any help on this much appreciated!

---

<div class="post-metadata">

**Author:** ![Philipp\_Kastner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/philipp_kastner/32/28797_2.png) [@Philipp\_Kastner](https://community.dynatrace.com/u/Philipp_Kastner)\
**Post date:** [March 22, 2021, 7:11am UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788/4 "2021-03-22T07:11:24Z")

</div>

You have two options.

1. You can store the user name via [api.setValue](https://www.dynatrace.com/support/help/shortlink/id_brower-clickpath-events#anchor-javascript-event-api)&nbsp;and use it in a subsequent keystroke events via placeholders for example {username}.

2. You set the value of the input directly via JavaScript.

Example

```javascript
api.startAsyncSyntheticEvent();
fetch('https://randomuser.me/api/').then((resp) => resp.json()).then(function(data) {

    // Option 1 - Store username via api.setValue to use in subsequent events
    api.setValue("username", data.results[0].name.first);

    // Option 2 - Set input value directly via JavaScript
    document.getElementById('username').value = data.results[0].name.first;

    api.finish();
}).catch(function(error) {
    api.fail('Fetch request to randomuser.me failed');
});

```

Using the placeholder in a subsequent keystroke event

 ![Philipp_Kastner_0-1616397056637.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8720c293586599b69a794f507ad7a682e4e20351.png)

Kind regards,

Philipp

---

<div class="post-metadata">

**Author:** ![jordan\_rose](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jordan\_rose](https://community.dynatrace.com/u/jordan_rose)\
**Post date:** [March 29, 2021, 5:15pm UTC](https://community.dynatrace.com/t/dynatrace-synthetic-monitoring-credentials-using-pam-api/30788/5 "2021-03-29T17:15:49Z")

</div>

Phillip, this is awesome, Thank you so much for replying with this info. I will do some testing to try to get this working…
