I am using the ‘AzureAITranslator’ API for text translation. After a few days of usage, I am getting this error:
StatusCode: 401, ReasonPhrase: 'Unauthorized'
I tried the following steps to get it to work but still getting the 'Unauthorized' error.
- I initially used Key 1 for text translation. I changed it to Key 2.
- Regenerated both the keys.
Following is the code being used:
private static string key ="-------";
private static readonly string endpoint = "https://api.cognitive.microsofttranslator.com/";
private static readonly string region = "-------";
public static async Task