Forum Discussion
PowerBI Rest API synchronous call in C#
- Anonymous7 years ago
Hi Ted,
Yeah you are almost right but we can use status column instead of start time / end time to identify whether API call got over or not. This is how I achieved it.
IRestResponse response = client.Execute(request);
var content = response.Content;string statusName = string.Empty;
if (switchControl.ToLower() == "sync")
{
while (statusName.ToLower() != "completed")
{
statusName = GetRefreshHistoryByDatasetId(res.GroupId, res.DatasetId, token);
if (statusName.ToLower() != "completed")
{
Thread.Sleep(sleepTime * 60 * 1000); //In minutes
}
if (statusName.ToLower() == "failed")
{
break;
}
continue;
}
}
Can you please advise how you generated the token
Can you please list out the steps that you have performed for this activity
Like Application Registartion , Permissions granted ..Admin Consent required or not ..etc