<?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: Get Activity Events API doesn't return activities when activities exist in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/1617556#M27432</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Observations after much head banging:&lt;/P&gt;
&lt;P&gt;- Query a period greater than 1 hour and you will get no events and a continuation token and uri that will repeat itself forever&lt;/P&gt;
&lt;P&gt;- Query for a period of 1 hour and life is good&lt;/P&gt;
&lt;P&gt;Process then is for each hour in the time horizon run your get until the continuation tokens end&lt;/P&gt;
&lt;P&gt;move on to the next hour&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 20:10:15 GMT</pubDate>
    <dc:creator>richbenmintz</dc:creator>
    <dc:date>2021-01-22T20:10:15Z</dc:date>
    <item>
      <title>Get Activity Events API doesn't return activities when activities exist</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/900516#M21998</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Admin API - Get Activity Events (GET &lt;A href="https://api.powerbi.com/v1.0/myorg/admin/activityevents)&amp;nbsp;" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/activityevents)&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;doesn't return data when activity data exists in the audit log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using "Admin - Get Activity Events" API it doesn't return data for dates in past 90 days&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using "Get-PowerBIActivityEvents" in Powershell results are returned correctly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example (The same user has been used and is a Power BI Administrator):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doesn't return data via API (&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents#code-try-0" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents#code-try-0&lt;/A&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBIActivityEvents from API #1 (20200115).JPG" style="width: 890px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/225703i1D0C54BD6D4A30CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="PBIActivityEvents from API #1 (20200115).JPG" alt="PBIActivityEvents from API #1 (20200115).JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBIActivityEvents from API #2 (20200115).JPG" style="width: 900px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/225705i3B1E7C19E62D977E/image-size/large?v=v2&amp;amp;px=999" role="button" title="PBIActivityEvents from API #2 (20200115).JPG" alt="PBIActivityEvents from API #2 (20200115).JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Return data via Powershell for same period:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBIActivityEvents from PS #1 (20200115).JPG" style="width: 846px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/225706i680101DC993DD5D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="PBIActivityEvents from PS #1 (20200115).JPG" alt="PBIActivityEvents from PS #1 (20200115).JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API has the same issue that was logged for the Powershell Activity Events which has been subsequently fixed :&amp;nbsp;&lt;A href="https://github.com/microsoft/powerbi-powershell/issues/191" target="_blank" rel="noopener"&gt;https://github.com/microsoft/powerbi-powershell/issues/191&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 09:09:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/900516#M21998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-15T09:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activity Events API doesn't return activities when activities exist</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/933209#M22318</link>
      <description>&lt;P&gt;After logging with MS Premier Support their investigation found that currently the RestAPI playground doesn’t support the token continuation logic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They pointed to blog post that introduced the activity log API:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;“As a general rule, regardless of the number of entries returned, if the results include a continuation token, make sure you call the API again with that token to retrieve the remaining data, until a continuation token is no longer returned. It can happen that a call even returns a continuation token without any event entries. But don’t let the absence of activity events distract you. Just keep calling back with that continuation token.&amp;nbsp;Here is how you can code against the continuation token that is returned in the response&lt;/EM&gt;”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Source:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://protect-eu.mimecast.com/s/rVWHCGZjRtJXx0gHpZxK6?domain=nam06.safelinks.protection.outlook.com" target="_blank" rel="noopener noreferrer"&gt;https://powerbi.microsoft.com/en-us/blog/the-power-bi-activity-log-makes-it-easy-to-download-activity-data-for-custom-usage-reporting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the playground API didn't work as first assumed we have subsequently implemented using continuation tokens within SSIS to retrieve data from the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some observations of how the API works - during testing we used Fiddler and the results were interesting - it appears for the hour periods you are calling it will call as many continuation tokens.&amp;nbsp; So...&lt;/P&gt;&lt;P&gt;For a 24 hour period (the max the API supports) it will call the API 24 times&lt;/P&gt;&lt;P&gt;For 8am - 8pm it would call 12 times&lt;/P&gt;&lt;P&gt;For 8am to 9:10am it would be called twice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes sense why an array returned can be empty and you have to continue calling even though no data is returned it appears to be querying the audit logs for each hour within the parameters passed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 12:16:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/933209#M22318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-14T12:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get Activity Events API doesn't return activities when activities exist</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/1617556#M27432</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Observations after much head banging:&lt;/P&gt;
&lt;P&gt;- Query a period greater than 1 hour and you will get no events and a continuation token and uri that will repeat itself forever&lt;/P&gt;
&lt;P&gt;- Query for a period of 1 hour and life is good&lt;/P&gt;
&lt;P&gt;Process then is for each hour in the time horizon run your get until the continuation tokens end&lt;/P&gt;
&lt;P&gt;move on to the next hour&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:10:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-Activity-Events-API-doesn-t-return-activities-when/m-p/1617556#M27432</guid>
      <dc:creator>richbenmintz</dc:creator>
      <dc:date>2021-01-22T20:10:15Z</dc:date>
    </item>
  </channel>
</rss>

