Forum Discussion

perhed's avatar
perhed
New Member
5 years ago
Solved

.Net GetActivityEventsAsync fails with Bad Request

Hi!   I am trying really hard to download the power bi logs but I'm failing miserabely.   The service principal is set to access the Power BI API and the user is a Power BI Admin and has a Power ...
  • perhed's avatar
    5 years ago

    The problem was solved by enclosing the dates in single quotes:

    var logs = await client.Admin.GetActivityEventsAsync(startDateTime:string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopStart), endDateTime:
    string.Format("'{0:yyyy-MM-ddTHH:mm:ss.FFFZ}'", loopEnd));

    If you use ContinuationToken make sure to both enclose it in sinqle quotes and UrlDecode it before passing it as a parameter.