0
votes

I have a couple of Translator Cognitive services setup in Global regions, but I would like to home some to Canada now for client data protection requirements.

As a test, I use curl with the following as per MS example: curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=fr" -H "Ocp-Apim-Subscription-Key: " -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'Hello, what is your name?'}]"

This works fine for services setup in the Global region, but if I create a new one using my preferred (Central Canada, or even US East,) I get the following error: {"error":{"code":401000,"message":"The request is not authorized because credentials are missing or invalid."}}

It says credentials missing or invalid, but the error seems misleading, likely means "not supported in this region," but I am looking for some confirmation why I can't run this; I didn't do anything special, I used the MS wizard to create the NMT engine - confused and frustrated by this.

Has anyone seen this before, or have suggestions what I can try to resolve this?

1

1 Answers

0
votes

Figured this out, needed an extra header to denote region when it's not Global, in my case: -H "Ocp-Apim-Subscription-Region: canadacentral"

Found in: Translator v3.0