Jump to content

Microsoft Translator Text API v3.0

Recommended Posts


I have to migrate to new microsoft translation api. I try to translate the text with the new RestDebugger. It seems to be easy reading the


I set all the RestDebugger properties i need but all i get is a "400:BadRequest", "One of the request inputs is not valid".

In the pics attached you can see how i configure the RestDebugger. I downloaded a c# demo project from https://github.com/MicrosoftTranslator/Text-Translation-API-V3-C-Sharp-Tutorial

After setting the COGNITIVE_SERVICES_KEY to my key,

change the url to TEXT_TRANSLATION_API_ENDPOINT = "https://api-eur.cognitive.microsofttranslator.com/{0}?api-version=3.0",

and comment out the two header entries

                //request.Headers.Add("Ocp-Apim-Subscription-Region", "westus");
                //request.Headers.Add("X-ClientTraceId", Guid.NewGuid().ToString());


all works well. I assume the problem is in the content body.


Can someone point me to the right direction?




Share this post

Link to post

I use https://api-eur.cognitive.microsofttranslator.com/translate?api-version=3.0@&from=en&to=de


That works well with the c# project with microsoft visual studio. The only difference between your and my URL is that i use the european located server "api-eur." instead of the us "api.".

I think i do something wrong in the RestDebuggers "user defined content".

Calling the "languages" ressources works well. There i do not need a request json content body parameter (see pics).  



Edited by psycodad

Share this post

Link to post

Found the solution:

- Empty TRestRequest.Ressource property

- Remove all parameters except the Header with the subscription key

- Use following BaseURL instead: https://api-eur.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=de


Now all works like expected. But i even do not know why i should not use the TRestRequest.Params and the Ressource property instead of the URL parameters...

  • Thanks 1

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now