Forum Discussion

WalTig's avatar
WalTig
Frequent Visitor
6 years ago

Facing problems with continuationUri for activityEventEntities (Admin - Get Activity Events)

I'm working with several Power BI API's and they all give me results. I don't use any SDK. I simply perform a HttpWebRequest in C# like this:

HttpWebRequest request;
request = System.Net.HttpWebRequest.CreateHttp(uri);
request.KeepAlive = true;
request.Method = "GET";
request.ContentLength = 0;
request.Headers.Add("Authorization", String.Format("Bearer {0}", AccessToken));

Never a problem with that. However . . . I cannot get the API working in case of the continuationUri for activityEventEntities. 

I tried two methods: using the continuationUri and getting an AccessToken by creating a new Azure AD Authentication Library (ADAL) context. This is the normal procedure for avery API. In this case: that gives me a 403-error. This I can understand somehow. There is not only a continuationUri. There is also a continuationToken. Not for nothing I assume. So, I tried the second method.

The second method is calling the API using both the continuationUri and the continuationToken. So I don't ask or create an access token myself. Only there is no difference in the result. Again a 403-error. 

 

My first request is giving good result (including a continuationUri and continuationToken):

Uri = https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2020-02-23T00:00:00.000Z'&endDateTime='2020-02-23T23:59:59.999Z'
Token = eyJ0eXAiOiJKV1{etc}

 

My continuation request (using the received continuationUri and continuationToken) is giving 403 result:

Uri = https://wabi-north-europe-c-primary-redirect.analysis.windows.net/v1.0/myorg/admin/activityevents?continuationToken='LDIwMjAtMDItM{etc}'
Token = LDIwMjAtMDItM{etc}

Now my question is: is there anyone who got this API (using the continuationUri for activityEventEntities) working ? If so: how ? What am I doing wrong?

2 Replies