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


      Using DotNetAuth (+ OAuthBase to assemble querystring)

      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.


      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(
      , 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;


      [/Code Block]

      DotNetAuth is here: http://samondotnet.blogspot.com.au/2012/12/introduction-to-dotnetauth.html
    • Show all 2 messages in this topic