<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to access Dynatrace platform API from a synthetic browser test in Synthetic Monitoring</title>
    <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302300#M3433</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/1433"&gt;@HannahM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;So I have the following browser test js node:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.startAsyncSyntheticEvent();

const url = 'https://TENANTURL.apps.dynatrace.com/platform/storage/query/v1/query:execute';
const payload = {
    "query": "fetch logs, from:now()-10m",
    "requestTimeoutMilliseconds": 10000
};

fetch(url, {
        method: 'POST',
        headers: {
            'accept': 'application/json',
            'Content-Type': 'application/json',
            'Authorization': 'Bearer TOKEN'
        },
        body: JSON.stringify(payload)
    })
    .then(response =&amp;gt; {
        if (!response.ok) {
            throw new Error(`HTTP ${response.status}`);
        }
        return response.json();
    })
    .then(data =&amp;gt; {
        if (data.state &amp;amp;&amp;amp; data.state !== 'SUCCEEDED') {
            api.fail("Query not complete inline, state: " + data.state);
            return;
        }
        api.info("GIL: records = " + (data.result ? data.result.records.length : 0));
        api.finish();
    })
    .catch(error =&amp;gt; {
        api.fail("GIL: fetch failed: " + error.message);
    });&lt;/LI-CODE&gt;&lt;P&gt;It runs after I navigate to my tenant url and being redirected to the sso page.&lt;BR /&gt;The fetch itself fails at the end and the message is plain "fetch failed". we've even changed the original website to another one. any thoughts? (I think this discussion is important to many use cases hence this is not directly also managed in a ticket - let me know if only a summary should be done here)&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2026 09:11:12 GMT</pubDate>
    <dc:creator>gilgi</dc:creator>
    <dc:date>2026-07-23T09:11:12Z</dc:date>
    <item>
      <title>How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/301939#M3428</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We're trying to build asynthetic browser test against a site that requires OTP.&lt;BR /&gt;As there is no direct API to get the OTP data from the provider we need to bypass it so we've created a "back door" workflow to extract it and generate a business event that will store the result. we now in the stage that we need to query it using DQL from the script but facing CORS error as the Dynatrace domain is different than the tested site.&lt;BR /&gt;&lt;BR /&gt;we already know the great &lt;A href="https://community.dynatrace.com/t5/Troubleshooting/How-to-get-a-OTP-from-an-API-and-use-it-in-a-Browser-Monitor/ta-p/239746" target="_blank" rel="noopener"&gt;article&lt;/A&gt; from&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/1433"&gt;@HannahM&lt;/a&gt;&amp;nbsp;however the current issue is how to avoid the CORS error when accessing the platform without signing in to the platform itself (as accessing the domain itself directly goes to the login page).&lt;BR /&gt;&lt;BR /&gt;Any ideas?&amp;nbsp;&lt;BR /&gt;Gil.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 06:28:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/301939#M3428</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2026-07-16T06:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302010#M3431</link>
      <description>&lt;P&gt;Does it matter that you only go to the login page? You could ignore the 401 error, if that's causing a failure, or is it that the login page is another domain so doesn't help?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 11:57:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302010#M3431</guid>
      <dc:creator>HannahM</dc:creator>
      <dc:date>2026-07-16T11:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302239#M3432</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/1433"&gt;@HannahM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seemed like it was not enough but found out there was another issue. we're testing it right now. will update.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Gil.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2026 10:53:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302239#M3432</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2026-07-22T10:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302300#M3433</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/1433"&gt;@HannahM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;So I have the following browser test js node:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;api.startAsyncSyntheticEvent();

const url = 'https://TENANTURL.apps.dynatrace.com/platform/storage/query/v1/query:execute';
const payload = {
    "query": "fetch logs, from:now()-10m",
    "requestTimeoutMilliseconds": 10000
};

fetch(url, {
        method: 'POST',
        headers: {
            'accept': 'application/json',
            'Content-Type': 'application/json',
            'Authorization': 'Bearer TOKEN'
        },
        body: JSON.stringify(payload)
    })
    .then(response =&amp;gt; {
        if (!response.ok) {
            throw new Error(`HTTP ${response.status}`);
        }
        return response.json();
    })
    .then(data =&amp;gt; {
        if (data.state &amp;amp;&amp;amp; data.state !== 'SUCCEEDED') {
            api.fail("Query not complete inline, state: " + data.state);
            return;
        }
        api.info("GIL: records = " + (data.result ? data.result.records.length : 0));
        api.finish();
    })
    .catch(error =&amp;gt; {
        api.fail("GIL: fetch failed: " + error.message);
    });&lt;/LI-CODE&gt;&lt;P&gt;It runs after I navigate to my tenant url and being redirected to the sso page.&lt;BR /&gt;The fetch itself fails at the end and the message is plain "fetch failed". we've even changed the original website to another one. any thoughts? (I think this discussion is important to many use cases hence this is not directly also managed in a ticket - let me know if only a summary should be done here)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2026 09:11:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302300#M3433</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2026-07-23T09:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302330#M3434</link>
      <description>&lt;P&gt;if I understood correctly, you have a Workflow that retrieve the OTP and stores as business events. And now, you are using the synthetic step to query this value to use it as authentication... right?&lt;/P&gt;&lt;P&gt;Why not store the OTP in a credential vault instead, that can be used natively by synthetics?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2026 18:30:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302330#M3434</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-07-23T18:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302400#M3435</link>
      <description>&lt;P&gt;I&amp;nbsp; should have thought of it myself!! thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/18264"&gt;@dannemca&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2026 05:55:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302400#M3435</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2026-07-26T05:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Dynatrace platform API from a synthetic browser test</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302502#M3436</link>
      <description>&lt;P&gt;That's what community is for!!!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2026 13:17:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/How-to-access-Dynatrace-platform-API-from-a-synthetic-browser/m-p/302502#M3436</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-07-28T13:17:10Z</dc:date>
    </item>
  </channel>
</rss>

