locked
Having a problem with BING translation RRS feed

  • Question

  • I get an access token just fine, but it's rather big/complex for what it should be

    "access_token" = "http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=LCARS_UI&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&Audience=http%3a%2f%2fapi.microsofttranslator.com&ExpiresOn=1368912192&Issuer=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&HMACSHA256=G%2bU2M3SNGpOrSwFxeLKThGAqE9KXhR2G4H8Hk2wm8Ok%3d"

    "scope" = "http://api.microsofttranslator.com"

    Should I process that in any way?

    Well I try translating text:

    "http://api.microsofttranslator.com/v2/Http.svc/Translate?text=" & Text & "&from=" & SrcLang & "&to=" & DestLang

    POST data: "appId=" & client_id & "&Authorization=Bearer " & access_token

    POST data: "Authorization=Bearer " & access_token

    (tried with and without the client_id)

    Should that be added to the URL instead? Cause I get:

    Error. Url=http://api.microsofttranslator.com/v2/Http.svc/Translate?text=Testing&from=en&to=tlh Message=Bad Request
    <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=3817.V2_Rest.Translate.2FA5FF96</p></body></html>


    • Edited by NeoTechni Saturday, May 18, 2013 9:23 PM
    Saturday, May 18, 2013 9:20 PM

Answers

  • Got it, just had to encode the access token/text
    • Marked as answer by NeoTechni Sunday, May 19, 2013 12:16 AM
    Sunday, May 19, 2013 12:16 AM

All replies

  • I tried the AJAX method since it would only be GET, and I get this error:

    "ArgumentException: The Web Token must have a signature at the end. The incoming token did not have a signature at the end of the token. : ID=0340.V2_Json.Translate.2F75A9EE"

    The web token is exactly as MS gave me! ARG

    Saturday, May 18, 2013 9:29 PM
  • Got it, just had to encode the access token/text
    • Marked as answer by NeoTechni Sunday, May 19, 2013 12:16 AM
    Sunday, May 19, 2013 12:16 AM