<?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 Example of how to get follow on pages in events API? in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Example-of-how-to-get-follow-on-pages-in-events-API/m-p/84444#M363</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am using python to extract all events through:&lt;/P&gt;
&lt;PRE&gt;https://{id}.live.dynatrace.com/api/v1/events/&lt;/PRE&gt;
&lt;P&gt;(described here: &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/events/how-do-api-consumers-read-the-events-feed" target="_self"&gt;https://www.dynatrace.com/support/help/dynatrace-a...&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It states: "Use the &lt;STRONG&gt;nextEventId&lt;/STRONG&gt; and &lt;STRONG&gt;nextEventStartTms&lt;/STRONG&gt; information to query the next batch of events if the total number of events exceeds the maximum batch size of 150 events per request."&lt;/P&gt;
&lt;P&gt;Does someone have an example of the follow-on GET requests. I have tried adding the two as parameters to the follow on request, but I am always getting back the first 150 event batch.&lt;/P&gt;
&lt;P&gt;Here is the extract from the python code:&lt;/P&gt;
&lt;PRE&gt;Parameters = {&lt;BR /&gt;    'Api-Token': ApiToken&lt;BR /&gt;}&lt;BR /&gt;r = requests.get(Uri, params=Parameters)&lt;BR /&gt;d = r.json()&lt;BR /&gt;&lt;BR /&gt;while d['nextEventStartTms'] &amp;gt; 0:&lt;BR /&gt;    Parameters = {&lt;BR /&gt;        'Api-Token': ApiToken,&lt;BR /&gt;        'nextEventStartTms': d['nextEventStartTms'],&lt;BR /&gt;        'nextEventId': d['nextEventId']&lt;BR /&gt;    }&lt;BR /&gt;    r = requests.get(Uri, params=Parameters)&lt;BR /&gt;    d = r.json()&lt;BR /&gt;    print(d['nextEventStartTms'], d['nextEventId'])&lt;BR /&gt;    time.sleep(2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Status Code =  200&lt;BR /&gt;Total Event Count:  1686&lt;BR /&gt;Time:  2018-06-27T09:53:37.733000  -  2018-07-27T09:53:37.733000&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 10:40:53 GMT</pubDate>
    <dc:creator>snikolic</dc:creator>
    <dc:date>2023-03-23T10:40:53Z</dc:date>
    <item>
      <title>Example of how to get follow on pages in events API?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Example-of-how-to-get-follow-on-pages-in-events-API/m-p/84444#M363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am using python to extract all events through:&lt;/P&gt;
&lt;PRE&gt;https://{id}.live.dynatrace.com/api/v1/events/&lt;/PRE&gt;
&lt;P&gt;(described here: &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/events/how-do-api-consumers-read-the-events-feed" target="_self"&gt;https://www.dynatrace.com/support/help/dynatrace-a...&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It states: "Use the &lt;STRONG&gt;nextEventId&lt;/STRONG&gt; and &lt;STRONG&gt;nextEventStartTms&lt;/STRONG&gt; information to query the next batch of events if the total number of events exceeds the maximum batch size of 150 events per request."&lt;/P&gt;
&lt;P&gt;Does someone have an example of the follow-on GET requests. I have tried adding the two as parameters to the follow on request, but I am always getting back the first 150 event batch.&lt;/P&gt;
&lt;P&gt;Here is the extract from the python code:&lt;/P&gt;
&lt;PRE&gt;Parameters = {&lt;BR /&gt;    'Api-Token': ApiToken&lt;BR /&gt;}&lt;BR /&gt;r = requests.get(Uri, params=Parameters)&lt;BR /&gt;d = r.json()&lt;BR /&gt;&lt;BR /&gt;while d['nextEventStartTms'] &amp;gt; 0:&lt;BR /&gt;    Parameters = {&lt;BR /&gt;        'Api-Token': ApiToken,&lt;BR /&gt;        'nextEventStartTms': d['nextEventStartTms'],&lt;BR /&gt;        'nextEventId': d['nextEventId']&lt;BR /&gt;    }&lt;BR /&gt;    r = requests.get(Uri, params=Parameters)&lt;BR /&gt;    d = r.json()&lt;BR /&gt;    print(d['nextEventStartTms'], d['nextEventId'])&lt;BR /&gt;    time.sleep(2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Status Code =  200&lt;BR /&gt;Total Event Count:  1686&lt;BR /&gt;Time:  2018-06-27T09:53:37.733000  -  2018-07-27T09:53:37.733000&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;BR /&gt;1532477700000 1386030597903004191&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 10:40:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Example-of-how-to-get-follow-on-pages-in-events-API/m-p/84444#M363</guid>
      <dc:creator>snikolic</dc:creator>
      <dc:date>2023-03-23T10:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Example of how to get follow on pages in events API?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Example-of-how-to-get-follow-on-pages-in-events-API/m-p/84445#M364</link>
      <description>&lt;P&gt;You have to use the next returned cursor value within the next request. Then you can iterate through the complete result set. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Mar 2019 13:57:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Example-of-how-to-get-follow-on-pages-in-events-API/m-p/84445#M364</guid>
      <dc:creator>wolfgang_beer</dc:creator>
      <dc:date>2019-03-18T13:57:34Z</dc:date>
    </item>
  </channel>
</rss>

