title: How to get access token from Dropbox Sync & Datastore xamarin component
body: <p>I trying get an access token from  Dropbox Sync &amp; Datastore xamarin component in Xamarin iOS project.I have used dropnet to get the access token but I'm getting an http exception :( let me know where I'm doing wrong</p>
  
  <pre><code> private static void GetAccessToken()
      {
          try
          {
  
              const string DropboxSyncKey = "XXXXXXXX";
              const string DropboxSyncSecret = "XXXXXX";
             //this url is obtained fromDBAccountManager.SharedManager.HandleOpenURL(url);
              string token = "db-XXXXXX://1/connect?oauth_token_secret=XXXXXXX&amp;state=xXXXXXXX&amp;uid=XXXXXX&amp;oauth_token=xXXXXXXXX";
              token = token.Substring(token.LastIndexOf("&amp;") + 13);
              string stoken = "db-XXXXXX://1/connect?oauth_token_secret=XXXXXXX&amp;state=xXXXXXXX&amp;uid=XXXXXX&amp;oauth_token=xXXXXXXXX";
              int indexof = stoken.IndexOf("?") + 20;
              int lastindex = stoken.IndexOf("&amp;") - indexof;
              string secrettoken = stoken.Substring(indexof, lastindex);
              var client = new DropNetClient(DropboxSyncKey, DropboxSyncSecret, token, secrettoken);
              var accesskey = client.GetAccessToken();
              Console.WriteLine(token);
              Console.WriteLine(secrettoken);
              Console.WriteLine(accesskey);
          }
          catch (Exception)
          {
          }
      }
  </code></pre>