0

I have been using PowerBI API to fetch the Audit log of PowerBI usages. From past 15 days, I was getting different column list previously BUT currently I am getting less columns from API itself.

Can anyone suggest why this is happening?

Details (API to fetch the data):

https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2023-03-12T00:00:00.000Z'&endDateTime='2023-03-12T23:59:59.999Z'

For API authentication I am using the following URL:

https://login.microsoftonline.com/<ApplicationID_of_Azure_APP_Registered>/oauth2/token

Body for above URL:

grant_type=client_credentials&resource=https://analysis.windows.net/powerbi/api&client_id=<Client_ID_OF_APP>&client_secret=<Client_Secret_OF_APP>

Content-Type: application/x-www-form-urlencoded

Screenshots for column list are attached below (Previously and Now):

Previously:

enter image description here

Now:

enter image description here

Robin
  • 85
  • 2
  • 12

1 Answers1

0

I tried to reproduce the same in my environment and got the results like below:

I created an Azure AD Application and granted API permissions:

enter image description here

Now I generated access token by using below parameters:

https://login.microsoftonline.com/TenantID/oauth2/token

client_id:ClientID
client_secret:ClientSecret
resource:https://analysis.windows.net/powerbi/api
grant_type:client_credentials

enter image description here

By using the above token, I tried to fetch API to get audit logs like below:

https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2023-03-12T00:00:00.000Z'&endDateTime='2023-03-12T23:59:59.999Z'

Check this MsDoc to check the sample output : Admin - Get Activity Events - REST API

enter image description here

By default based on the size, the response will be in the below form:

{
"activityEventEntities": [],
"continuationUri": null,
"continuationToken": null,
"lastResultSet": true
}
  • When obtaining large amounts of data from an API, such as audit logs in Power BI, continuation tokens and URIs are generated.
  • In this scenario, the API will generate a continuation token and URI that can be used to retrieve the next batch of data.
Rukmini
  • 6,015
  • 2
  • 4
  • 14