question

Terry-3976 avatar image
0 Votes"
Terry-3976 asked romungi-MSFT commented

azure translation authorization error

Hi

I create a cognitive services resource in my portal and create the text translate in this service.

I try the sample(Authenticating with a global resource) as below

https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference

but error occurred

error message :
{"error":{"code":401000,"message":"The request is not authorized because credentials are missing or invalid."}}

azure-cognitive-servicesazure-translator
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered romungi-MSFT commented

@Terry-3976 Could you please check if you are using the authentication headers in your request? You could use the bearer token with authorization header or Ocp-Apim-Subscription-Key with the secret value of your resource. If you have created a global translator resource then you should use the Ocp-Apim-Subscription-Key header instead.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Terry-3976 DId you get a chance to review the above suggestion and review your request?

0 Votes 0 ·
08221949 avatar image
2 Votes"
08221949 answered romungi-MSFT commented

My Error when I want create Translator

Не удалось вычислить функцию: [filter(parse('[{"label": ""Бесплатный" F0 (до 2 млн символов на перевод в месяц)", "value": "F0"}, {"label": ""Стандартный" S1 (оплата по мере использования)", "value": "S1"}, {"label": ""Стандартный" S2 (ежемесячное обязательство — 250 млн символов)", "value": "S2"}, {"label": ""Стандартный" S3 (ежемесячное обязательство — 1 млрд символов)", "value": "S3"}, {"label": ""Стандартный" S4 (ежемесячное обязательство — 10 млрд символов)", "value": "S4"},{"label": "C2 (ежемесячное обязательство — 62,5 млн символов)", "value": "C2"},{"label": "C3 (ежемесячное обязательство — 250 млн символов)", "value": "C3"},{"label": "C4 (ежемесячное обязательство — 2,5 млрд символов)", "value": "C4"}]'),(dropdownItem) => contains(map(filter(basics('checkSkuAvailableApi').value, (sku) => sku.skuAvailable), (availableSku) => availableSku.skuName), dropdownItem.value))]

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have the same error

0 Votes 0 ·

Could you please post how the request is formed i.e the endpoint, headers and parameters used? Example: For a global resource the request should look like below:

 // Pass secret key using headers
 curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=es" \
      -H "Ocp-Apim-Subscription-Key:<your-key>" \
      -H "Content-Type: application/json" \
      -d "[{'Text':'Hello, what is your name?'}]"


0 Votes 0 ·

22742-kaxmjg4tk4n36r1.png



This error occurs when creating

0 Votes 0 ·
kaxmjg4tk4n36r1.png (86.6 KiB)
Show more comments