1
votes

I am trying to use Microsoft translator API for my projects. The problem is that I am not able to get the access token which is used for translation. I am making the following request from JavaScript using the POST method.

"**https://datamarket.accesscontrol.windows.net/v2/OAuth2-13?client_id='ID'&client_secret='secretKey'&scope='http://api.microsofttranslator.com'&grant_type='client_credentials'**"

I am getting the following error:

"{"readyState":4,"responseText":"{\"error\":\"invalid_request\",\"error_description\":\"ACS90007: Request method not allowed.\\r\\nTrace ID: bd12508b-1d2b-420c-a4e0-360ca666c97b\\r\\nTimestamp: 2013-03-05 20:39:39Z\"}","status":400,"statusText":"Bad Request"}"
1

1 Answers

0
votes

The 'Request Method Not Allowed' error usually happens when you GET a page that needs to be POSTed. I see that you say you are POSTing, so can you publish some more code?

That being said, getting your access token in JS in the browser is not recommended...it's best to use a server-side app in PHP/ASP.NET/Node to get the token and return it to your JS.

More here: http://social.msdn.microsoft.com/Forums/en-US/microsofttranslator/thread/cbb136e4-d67a-4902-acc0-986606c9c726/