<?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: Post Execution Script Question in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211966#M2492</link>
    <description>&lt;P&gt;Thanks, I'll try that and report back.&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2023 17:57:33 GMT</pubDate>
    <dc:creator>GregOReilly</dc:creator>
    <dc:date>2023-05-11T17:57:33Z</dc:date>
    <item>
      <title>Post Execution Script Question</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211949#M2490</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;
&lt;P&gt;I am needing to test an API and WITE Data to record. (Its a test record in our production env). Doing this is fine, however, the next time I run the same test, I get an error that the data exists.&lt;/P&gt;
&lt;P&gt;Can I add a post execution script to validate that the data was correctly added (read the response) and then run a 2nd http api test to delete the data we just added. If the data was not written, I do not want to run the 2nd script, but send an alert instead. (want to avoid repearing failures over and over on a production record)&lt;/P&gt;
&lt;P&gt;This proved that my API's are available, working, writing, deleting etc.&lt;/P&gt;
&lt;P&gt;There are 20-30 different scenarios we need this to take place as the majority of the services we interact with are SaaS and we have no records of logs/events to tell us when something breaks.&lt;/P&gt;
&lt;P&gt;Your help is appreciated.&lt;/P&gt;
&lt;P&gt;Greg&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 08:52:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211949#M2490</guid>
      <dc:creator>GregOReilly</dc:creator>
      <dc:date>2023-05-12T08:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Post Execution Script Question</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211962#M2491</link>
      <description>&lt;P&gt;In theory, yes, you can.&lt;/P&gt;&lt;P&gt;You can code a javascript to read the response from the POST (response.getResponseBody()) and work with conditions (if|else) to plan the next event as a Delete, or to skip it with &lt;SPAN&gt;&lt;A href="https://www.dynatrace.com/support/help/platform-modules/digital-experience/synthetic-monitoring/http-monitors/pre-and-post-scripting-for-http-monitors#skip-http-requests%20" target="_self"&gt;api.skipNextRequest()&lt;/A&gt;. You can force an alert with api.&lt;SPAN class=""&gt;fail().&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Please try the &lt;A href="https://www.dynatrace.com/support/help/platform-modules/digital-experience/synthetic-monitoring/http-monitors/pre-and-post-scripting-for-http-monitors#methods" target="_self"&gt;apis for HTTP Monitor&lt;/A&gt;, and let us know.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 17:24:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211962#M2491</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2023-05-11T17:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Post Execution Script Question</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211966#M2492</link>
      <description>&lt;P&gt;Thanks, I'll try that and report back.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 17:57:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Post-Execution-Script-Question/m-p/211966#M2492</guid>
      <dc:creator>GregOReilly</dc:creator>
      <dc:date>2023-05-11T17:57:33Z</dc:date>
    </item>
  </channel>
</rss>

