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

5347Frustrated and about to give up :(

Expand Messages
  • agentty
    May 23 1:46 PM
    • 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
    • Show all 2 messages in this topic