Reputation: 77
I want to use microsoft translation api. But there are so many new and old one like below.
How to use Bing Translation API?
I want to use "GET /Translate", and used "Bearer" + " " + access token instead of "appid".
Results is here.
Do I need "" for access token? Either way, it doesn't work. humm I'm using this site below to try. Thanks!
http://docs.microsofttranslator.com/oauth-token.html
http://docs.microsofttranslator.com/text-translate.html#!/default/post_TranslateArray
<html>
<body>
<h1>Argument Exception</h1>
<p>Method: Translate()</p>
<p>Parameter: appId</p>
<p>Message: Invalid appId
Parameter name: appId</p>
<code></code>
<p>message id=1446.V2_Rest.Translate.27848FC7</p>
</body>
</html>
Upvotes: 3
Views: 2321
Reputation: 47
You don't need to put quotes around the word Bearer and the other stuff you added, just the word
Bearer
followed by a space and then the token. No need for anything else.
When you use the appid then the token is part of the query string. If you use Authorization then the token is part of the header.
To try out the method on the doc.microsofttranslator.com site, just put; Bearer and token in the appid.
Upvotes: 5
Reputation: 701
Taken from the documentation of the API:
REQUIRED. If the Authorization header is used, leave the appid field empty else specify a string containing "Bearer" + " " + access token.
So for your value for appId, you want to do the following:
Upvotes: 5