If it helps: that's the code for one of the forge API:
public static async Task <string> AuthenticateToken()
{
try
{
Uri baseUrl = new Uri("https://developer.api.autodesk.com/authentication/v1/authenticate");
var nvc = new List<KeyValuePair<string, string>>();
nvc.Add(new KeyValuePair<string, string>("client_id", _clientId));
nvc.Add(new KeyValuePair<string, string>("client_secret", _clientSecret));
nvc.Add(new KeyValuePair<string, string>("grant_type", "client_credentials"));
nvc.Add(new KeyValuePair<string, string>("scope", "data:create data:read data:write"));
var client = new HttpClient();
var content = new FormUrlEncodedContent(nvc);
var response = await client.PostAsync(baseUrl, content);
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
var jSon = (JObject)JsonConvert.DeserializeObject(result);
string token = (string)jSon["access_token"];
return token;
}
}
catch(Exception ex)
{ throw ex; }
return null;
}
And that's the exception that I get when I post it:
![amilcarferreira_0-1634636333058.png amilcarferreira_0-1634636333058.png]()