locked
Bing Translator API is unstable! RRS feed

  • Question

  • Hi,

    I have registered for the free subscription plan of the bing translator api.

    My C# looks fine as I have suceeded several time to get some translations. However most of the time it does not work and I get back a server error: "The remote server returned an error :400 (Bad Request)". I am obviously taking care of renewing the token (either using a TIMER or by renewing the token before every new request). Also, I have only done a few translations so I am far from the 2 000 000 characters monthly limit.

    What should I do?

    Thanks,

    Mica

    Monday, September 23, 2013 1:58 PM

All replies

  • Hi Mica,

    400 is a hint toward an incorrectly formatted request. Please make sure that the request is properly URL encoded, and that the parameters are sent in the exact same order as our MSDN samples suggest. You may also want to look at the error detail that is being returned to you, it will contain further information on the element that is wrong.

    If that doesn't help, please post your code and the contact of a failing request here, or send to mtcont at microsoft.com.

    Your Microsoft Translator team

    Tuesday, September 24, 2013 12:34 PM
  • Hi Chris,

    Thank you for the reply.

    I don't think there is a problem with the URL, or with the request format since when I perform exactly the same request again and again, it sometimes works and sometimes does not. 

    May be there is a problem with the token? Is there a limitation on the number of times per minutes, one can ask for a new token? Indeed, in order to be sure that the token is fine, I am renewing it before each new request. More specifically, when debugging, I may have tried to renewed the token several times (say 3 times) per minute. Note that I have at least checked the fact that each token renewal produces a different token.

    Also, is there a specific field in the error message, that could help to better understand the problem?

    Thank you,

    Mica

     

    Tuesday, September 24, 2013 1:35 PM
  • Hi Mica,

    the token is valid for 10 minutes, best if you can use it for that long, but I am sure you have not exhausted the limit of token distributions. I suspect that it has to do with the URL encoding of the token: you have one too many or one too few UrlEncode() statements on the token. If the token happens to have no encodable character it works, if it has one it fails.

    Capture the entire token in a failing case and in a succeeding case and check the difference.

    Hope this makes sense,
    Your Microsoft Translator team

    Tuesday, September 24, 2013 4:52 PM