I'm trying to get thumbnail from Forge API here
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/thumbnails/urn-thumbnail-GET/ `
I got it with Postman and axios successfully, and I tried it with RestSharp, HttpClient and GetThumbnail from DerivativesApi (Autodesk.Forge) in C# but only got status code 202 with message:
{"Result":"The thumbnail generating for this graph node is pending"}
I realized that RestSharp and HttpClient only receive code 202 and return results. I don't know how I can wait for code 200 and thumbnail. Can anyone help me?
This is my code:
var request = new RestRequest($"https://developer.api.autodesk.com/modelderivative/v2/designdata/{nameHash}/thumbnail", Method.GET);
request.AddHeader("Authorization", $"Bearer {oauth.access_token}");
var client = new RestClient();
var restRes = client.Execute(request);