1
votes

After creating a service for Text Translator of Azure service, the end point when tried with the one of the keys provided returns a json object with 404 error code and Message "Resource not found"

{
    "error": {
        "code": "404",
        "message": "Resource not found"
    }
}

Postman Parameters used are:

URL: https://agro.cognitiveservices.azure.com/translate?api-version=3.0&to=ta,en

Body JSON:

{
    [
        "Text" : "Hello World"
    ]
}

With Ocp-Apim-Subscription-Key parameter in header, is that which was given as the subscription key for cognitive service of Azure when registering.

NOTE: HTTP POST Method used.

Please suggest a solution to resolve the problem and THANK YOU for this.

Screenshot Shared below as link: enter image description here

1
Please provide sample Postman / any language code sample with your Key redacted / removed.Sanket Tarun Shah
Yes wilco @SanketTarunShah, please check on the above question edit, thanks for replySrinivas Kishan

1 Answers

1
votes

Looking at Microsoft docs, your endpoint seems to be invalid. See https://docs.microsoft.com/en-us/azure/cognitive-services/translator/quickstart-translate?pivots=programming-language-javascript

HTTP POST Endpoint: https://api.cognitive.microsofttranslator.com/?api-version=3.0&to=ta,en

    headers: {
      'Ocp-Apim-Subscription-Key': subscriptionKey,
      'Content-type': 'application/json',
      'X-ClientTraceId': uuidv4().toString()
    }

Body:

    body: [{
          'text': 'Hello World!'
    }]