Hi I am writing .Net implementation for downloading the historical data for intraday summaries. When I am doing the Get request to see if extraction has been completed, the token seems to become invalid in while loop. I thought token is valid for 24 hrs. Could you please advise?
Thanks
Bhawana
public async Task CheckStatus(Uri locationUrl)
{
using var client = new HttpClient();
var statusCode = HttpStatusCode.Accepted;
var request = new HttpRequestMessage(HttpMethod.Get, locationUrl);
request.Headers.Add("Prefer", "respond-async");
request.Headers.Add("Authorization", "Token " + dssClient._token);
while (statusCode != HttpStatusCode.OK)
{
var response = await client.GetAsync(request.RequestUri, HttpCompletionOption.ResponseHeadersRead);
statusCode = response.StatusCode;
}
GetData(locationUrl.ToString());
}