Loading ...
Sorry, an error occurred while loading the content.

Frustrated and about to give up :(

Expand Messages
  • agentty
    I had been happily using the free GEO API for some time, until it suddenly stopped working. So after searching about I found out that BOSS was taking over. I
    Message 1 of 2 , May 23, 2013
    • 0 Attachment
      I had been happily using the free GEO API for some time, until it suddenly stopped working. So after searching about I found out that BOSS was taking over. I don't mind paying for my usage, your pricing seems fair... however I have spent more time than I can afford trying to move to the new API with no success and little good documentation on the process.

      No matter what requests I generate, I get a "signature_invalid" response from the API endpoint. I have setup multiple Boss "projects" with different settings, attached credit cards, then tried and tried and tried again. I've used two different OAuth libraries to generate a signature... to no avail. Below are two HTTP requests sent to the server that returned the signature_invalid error...


      Using OAuthBase from code sample here: http://developer.yahoo.com/boss/geo/docs/codeexamples.html#oauth_csharp

      http://yboss.yahooapis.com/geo/placefinder?
      location=2222+AnyStreet+Rd%2c+Las+Vegas%2c+NV+89146
      &oauth_consumer_key=MyBigLongKey--
      &oauth_nonce=5809422
      &oauth_signature_method=HMAC-SHA1
      &oauth_timestamp=1369337444
      &oauth_version=1.0
      &oauth_signature=iQldrWhDyl8ZsJlpX4gAoFRBaoI=


      Using DotNetAuth (+ OAuthBase to assemble querystring)
      http://yboss.yahooapis.com/geo/placefinder?
      location=2320+Duneville+St%2c+Las+Vegas%2c+NV+89146
      &oauth_consumer_key=dj0yJmk9OWs3RkJkUTM0aHZEJmQ9WVdrOVV6VkJNV1owTXpZbWNHbzlNVFF6TURRd01qYzJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0xNA--
      &oauth_nonce=GeTQvYmBmejxtYdWwcXHmoMEFQBBlvOtJPEYY
      &oauth_signature_method=HMAC-SHA1
      &oauth_timestamp=1369340510
      &oauth_version=1.0
      &oauth_signature=DP57WE8Zv9vuOc8RfjiAzY+qTx0=

      So what am I doing wrong? Please let me know, I'd rather not move to another third party service but I've gotta get this done.

      Thanks
      -Ty


      My CSharp Code Samples

      [Code Block]

      const string ServiceUrlNormal = "http://yboss.yahooapis.com/geo/placefinder?location={0}";

      public static XPathDocument GeoCodeAddress(string strQuery)
      {

      //This way uses DotNetAuth to generate signature
      var uri = new Uri(String.Format(ServiceUrlNormal, HttpUtility.UrlEncode(strQuery)));
      string url, param;
      var oAuth = new DotNetAuth.OAuth1a.Providers.YahooOAuth1a();
      var nonce = oAuth.GenerateNonce();
      var timeStamp = oAuth.GetTimestampValue();
      DotNetAuth.OAuth1a.Framework.ParameterSet[] objParams = new DotNetAuth.OAuth1a.Framework.ParameterSet[0];

      var signature = oAuth.GetSignature(
      ServiceConsumerSecret
      , ServiceConsumerKey
      , uri.ToString(), "GET", objParams);

      var oAuthBase = new OAuthBase();
      var signatureOld = oAuthBase.GenerateSignature(uri, ServiceConsumerKey,
      ServiceConsumerSecret, string.Empty, string.Empty, "GET", timeStamp, nonce,
      OAuthBase.SignatureTypes.HMACSHA1, out url, out param);

      string strReq = string.Format("{0}?{1}&oauth_signature={2}", url, param, signature);

      using (var response = WebRequest.Create(strReq).GetResponse())
      {
      XPathDocument xmlDoc = LoadXmlResponse(response);
      //return xmlDoc;
      }


      //This way uses OAuthBase to generate signature
      var uri2 = new Uri(String.Format(ServiceUrlNormal, HttpUtility.UrlEncode(strQuery)));
      string url2, param2;
      var oAuth2 = new OAuthBase();
      var nonce2 = oAuth2.GenerateNonce();
      var timeStamp2 = oAuth2.GenerateTimeStamp();
      var signature2 = oAuth2.GenerateSignature(uri2, ServiceConsumerKey,
      ServiceConsumerSecret, string.Empty, string.Empty, "GET", timeStamp2, nonce2,
      OAuthBase.SignatureTypes.HMACSHA1, out url2, out param2);

      string strReq2 = string.Format("{0}?{1}&oauth_signature={2}", url2, param2, signature2);

      using (var response = WebRequest.Create(strReq2).GetResponse())
      {
      XPathDocument xmlDoc = LoadXmlResponse(response);
      //return xmlDoc;
      }

      }
      &oauth_signature=DP57WE8Zv9vuOc8RfjiAzY+qTx0=

      [/Code Block]

      DotNetAuth is here: http://samondotnet.blogspot.com.au/2012/12/introduction-to-dotnetauth.html
    • Sven Hartrumpf
      Hi. ... Encoding space as + is wrong. Please check the documentation or/and the archive of this mailing list. Sven
      Message 2 of 2 , May 23, 2013
      • 0 Attachment
        Hi.

        Thu, 23 May 2013 20:46:20 -0000, catch2 wrote:
        > location=2222+AnyStreet+Rd%2c+Las+Vegas%2c+NV+89146

        Encoding space as + is wrong. Please check the documentation
        or/and the archive of this mailing list.

        Sven
      Your message has been successfully submitted and would be delivered to recipients shortly.