For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
23 0 0 2

Check Status returns unauthorized

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());


}

#technologydss-rest-apihistorical
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
23 0 0 2

I think I missed this. It's fine w. please close the ticket


client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Token",dssClient._token);

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.