Forum Discussion
Power BI Rest API continuation token is corrupted
- Anonymous6 years ago
Hi Anonymous
Yes, yous should not use the continuationToken, but the continuationUri, and use it to make a new get request.
The documentation for this API is poor and outdated, unfortunately.
Let me know if you need further assistance.
Hi,
Did you manage to get this fixed?
I have tried using the token but keep getting the same errors as you. I have put single quotes around the token, double quotes as well.
Cheers,
liljath
- Anonymous6 years agoNot applicable
Hi Anonymous
Yes, yous should not use the continuationToken, but the continuationUri, and use it to make a new get request.
The documentation for this API is poor and outdated, unfortunately.
Let me know if you need further assistance.- Anonymous6 years agoNot applicable
Hi Anonymous ,
Thank you for this 🙂 it's been driving me crazy lol
Do you know if it possible to use the powerbiclient from the package Microsoft.PowerBI.Api?
I am using pbiClient.Admin.GetActivityEvents(startdate, enddate) to get the first call but when I put the continuationtoken in there it just doesn't work.
I was thinking maybe something like powerbiclient.httpclient ... but have tried this with a 403 result.
Do you call the api with this client or a normal httpclient?
cheers,
liljath
- Anonymous6 years agoNot applicable
Hi Anonymous
I am currently using Power Automate to pull the data one a day. You can read more about the general idea here:
https://medium.com/@Konstantinos_Ioannou/refresh-powerbi-dataset-with-microsoft-flow-73836c727c33
It is an old article showing you how to refresh a dataset uding Power Automate (this article is from before it was possible with a simple connector)
If you are using Powershell you can use the PBI Cmdlets (read more here). Once that is installed you can run requests from Powershell. Here is an example, where the logs are saved in .json files for each individual day:Login-PowerBI
$date = [datetime]'07/10/2020'
$array =
do {
$date.ToString('yyyy-MM-dd')
$date2 =(Get-Date $date -Format 'yyyy-MM-dd')
$begindate=-join($date2,'T00:00:00')
$enddate =-join($date2,'T23:59:59')
$paths =-join('C:\audit\',$date2,'.json')
$activities = Get-PowerBIActivityEvent -StartDateTime $begindate -EndDateTime $enddate | Out-File $paths
$date = $date.AddDays(1)
}
until ($date -gt [datetime]'07/14/2020')
- allenwilson4 years agoNew Member
Hi.
I'm having the same issue with the SDK and have been unable to figure out how to use the continuationUri that you mentioned with the SDK. The SDK works quite well for all of the various pieces of data that I am consuming, and it even works fine for activities too provided I ignore the continuation token. Every attempt to use that so far has failed.
Do you have an example of using the continuationUri with the SDK specifically?
- MForMarlon9 days agoNew Member
Hi all, I have just recently come across this problem with the GetUserSubscriptionsAsAdmin API. On the first call, the API returns data with a proper continuationToken. However, calling it the second time with the continuationToken gives me more data and another continuationToken that appears to be corrupt, as I tried calling it the third time with the new token, and it comes back with 400 Bad Request and this in the response:
{ "error": { "code": "InvalidRequest", "message": "Looks like that continuation token is corrupted. Replace it with the same continuation token that was sent back in the previous API response, and try again" } }For now, I just hard-coded my app to call the API twice. Pretty frustrating to find out that the API is buggy.