I suscribed for the free Azure trial to use the Dictionary Lookup feature and got this endpoint and (redacted) API key :
Grab your keys and endpoint
key1
084***13
Endpoint
https://westeurope.api.cognitive.microsoft.com/
Every call to Cognitive Services requires the subscription key above. This key needs to be either passed through a query string parameter or specified in the request header. To manage your keys, use the Keys option from the left menu
Then on this page I find a simple example, where it seems I just have to substitute the key:
curl -X POST "https://api.cognitive.microsofttranslator.com/dictionary/lookup?api-version=3.0&from=en&to=es" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json" -d "[{'Text':'fly'}]"
I test it in my command line, replacing the key, but no success :
curl -X POST "https://api.cognitive.microsofttranslator.com/dictionary/lookup?api-version=3.0&from=en&to=es" -H "Ocp-Apim-Subscription-Key: 084***13" -H "Content-Type: application/json" -d "[{'Text':'fly'}]
{"error":{"code":401000,"message":"The request is not authorized because credentials are missing or invalid."}}
I try to change the endpoint, but no success either :
curl -X POST "https://westeurope.api.cognitive.microsoft.com/dictionary/lookup?api-version=3.0&from=en&to=es" -H "Ocp-Apim-Subscription-Key: 084***13" -H "Content-Type: application/json" -d "[{'Text':'fly'}]
{"error":{"code":"404","message": "Resource not found"}}
I assume I'm missing something obvious but the doc isn't exactly newb friendly. What should I do ?