<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API Version in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121782#M3540</link>
    <description>&lt;P&gt;What SDK are you using? Can you share your code?  Can you copy any output you are getting?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2015 00:03:28 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-03-27T00:03:28Z</dc:date>
    <item>
      <title>API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121778#M3536</link>
      <description>&lt;P&gt;We have a mobile app accessing Dopbox.  We have cloned the app and customized it from another customer.  I can use the old keys and can access Dropbox with new app.  If I use the new keys created for the new app,  I can't access it.  Is there a new API that we need to change that wasn't required before?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:44:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121778#M3536</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2019-05-29T09:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121779#M3537</link>
      <description>&lt;P&gt;What exactly do you mean when you say "can't access it"? What error are you getting?&lt;/P&gt;

&lt;P&gt;One thing to note is that access tokens are app-specific, so you can't use an access token from the original app with the new app key and secret. If that is what you're trying to do, you'll need to process the app authorization flow again, this time using the new app key and secret, in order to get an access token for the new app.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 23:50:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121779#M3537</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-03-26T23:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121780#M3538</link>
      <description>&lt;P&gt;I don't see anything.  No error.  If I looking at the developer console.  I don't see any developer access count.  Just strange that all I am doing is changing the key values.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 23:56:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121780#M3538</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-26T23:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121781#M3539</link>
      <description>&lt;P&gt;Also to note, another developer is writing the IOS version and his app is working.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 23:58:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121781#M3539</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-26T23:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121782#M3540</link>
      <description>&lt;P&gt;What SDK are you using? Can you share your code?  Can you copy any output you are getting?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:03:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121782#M3540</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-03-27T00:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121783#M3541</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;//Dropbox variables
final static private String DROPBOX_APP_KEY = "Key Here";
final static private String DROPBOX_APP_SECRET = "App Secret Here";
final static private AccessType DROPBOX_ACCESS_TYPE = AccessType.DROPBOX;
public DropboxAPI&amp;lt;AndroidAuthSession&amp;gt; mDBApi;


private void initializeDropbox() {
    AppKeyPair appKeys = new AppKeyPair(DROPBOX_APP_KEY, DROPBOX_APP_SECRET);
    AndroidAuthSession session = new AndroidAuthSession(appKeys, DROPBOX_ACCESS_TYPE);
    mDBApi = new DropboxAPI&amp;lt;AndroidAuthSession&amp;gt;(session);
    //Create DropboxUtil class that will be used in this app's Javascript 
    DropboxUtils dropboxUtils = new DropboxUtils(this, appView);
    appView.addJavascriptInterface(dropboxUtils, "DropboxUtils");
    ///////
}

import com.dropbox.client2.DropboxAPI;
import com.dropbox.client2.android.AndroidAuthSession;
import com.dropbox.client2.session.AccessTokenPair;
import com.dropbox.client2.session.AppKeyPair;
import com.dropbox.client2.session.Session.AccessType;  



public boolean isDropBoxAuthenticated() {
    String key    = mPrefs.getString("dropboxAuthKey", null);
    String secret = mPrefs.getString("dropboxAuthSecret", null);

    if (key != null &amp;amp;&amp;amp; secret != null) {
        if (mDBApi.getSession().isLinked())
            return true;
        else {
            AccessTokenPair access = new AccessTokenPair(key, secret);
            mDBApi.getSession().setAccessTokenPair(access);             
        }

        if (mDBApi.getSession().isLinked())
           return true;
        else 
           return false;
    }
    return false;
}

public void dropBoxAuthenticate(String queryParams) {
        SharedPreferences.Editor ed = mPrefs.edit();
        ed.putString("queryParams", queryParams); 
        ed.putBoolean("dbAuthenticating", true);
        ed.commit();
        //Log.i(LOG_TAG, "**queryParams " + queryParams);
        mDBApi.getSession().startAuthentication(App.this);
}

protected void onResume() {
    super.onResume();

    boolean dbAuthenticating = mPrefs.getBoolean("dbAuthenticating", false);
    if (mDBApi.getSession().authenticationSuccessful() &amp;amp;&amp;amp; dbAuthenticating) {
        try {
            // MANDATORY call to complete auth.
            // Sets the access token on the session
            mDBApi.getSession().finishAuthentication();

            AccessTokenPair tokens = mDBApi.getSession().getAccessTokenPair();

            // Provide your own storeKeys to persist the access token pair
            // A typical way to store tokens is using SharedPreferences
            SharedPreferences.Editor ed = mPrefs.edit();
            ed.putString("dropboxAuthKey", tokens.key);
            ed.putString("dropboxAuthSecret", tokens.secret);               
            String queryParams = mPrefs.getString("queryParams", null);
            ed.remove("queryParams");
            ed.remove("dbAuthenticating");
            ed.commit();
            super.loadUrl("file:///android_asset/www/dropboxFileBrowser.html" + (queryParams == null ? " : queryParams));
        } catch (IllegalStateException e) {
            //Log.i(LOG_TAG, e.getMessage());
        }
    } else {
        if (mPrefs.getBoolean("appInit", true) == true) {
            //This condition occurs because of displaying the splash screen
            SharedPreferences.Editor ed = mPrefs.edit();
            ed.putBoolean("appInit", false);            
            ed.commit();
        } else {
            String queryParams = mPrefs.getString("queryParams", " ");
            if (queryParams.indexOf("editProfile") != -1) {
                //This condition occurs if the user cancels dropbox authentication 
                //and facebook authentication
                SharedPreferences.Editor ed = mPrefs.edit();
                ed.remove("queryParams");
                ed.commit();
                super.loadUrl("file:///android_asset/www/profile.html?editProfile=1");
            }
            else if (nativeAppLoggedIn()) {
                //Log.i(LOG_TAG, "**Going to index");
               super.loadUrl("file:///android_asset/www/index.html");
            }
            else {
                //Log.i(LOG_TAG, "**Going to login");
               //super.loadUrl("file:///android_asset/www/login.html");
            }
        }
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:13:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121783#M3541</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-27T00:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121784#M3542</link>
      <description>&lt;P&gt;Not sure how the paste screen shots here.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:17:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121784#M3542</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-27T00:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121785#M3543</link>
      <description>&lt;P&gt;Thanks, that's helpful. Ok, so it looks like you're using the &lt;A href="https://www.dropbox.com/developers/core/sdks/android" rel="nofollow noreferrer"&gt;Android Core SDK&lt;/A&gt;. That presumably means you're using either Eclipse or Android Studio. In either case, when you use &lt;CODE&gt;mDBApi&lt;/CODE&gt; to make an actual API call after all of the setup you have here, if something went wrong it would raise an exception with specific information about the issue.&lt;/P&gt;

&lt;P&gt;I don't see where you make an API call using &lt;CODE&gt;mDBApi&lt;/CODE&gt; in the provided code (presumably you do that later?), but I do see what I suspect is the issue. Specifically:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    String key    = mPrefs.getString("dropboxAuthKey", null);
    String secret = mPrefs.getString("dropboxAuthSecret", null);
    ...
    AccessTokenPair access = new AccessTokenPair(key, secret);
    mDBApi.getSession().setAccessTokenPair(access);             
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like you're retrieving a pre-existing access token, presumably for the old app. Since access tokens (the &lt;CODE&gt;dropboxAuthKey&lt;/CODE&gt; and &lt;CODE&gt;dropboxAuthSecret&lt;/CODE&gt; pair in your code) are specific to apps, you'll need to get a new access token for the new app key/secret.&lt;/P&gt;

&lt;P&gt;If that doesn't seem to be the problem, e.g., if the code isn't going through that code path, please copy the relevant output you get when you run this. E.g., from logcat.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:27:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121785#M3543</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-03-27T00:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121786#M3544</link>
      <description>&lt;P&gt;The code is here.  Just a little different from your example&lt;/P&gt;

&lt;P&gt;private void initializeDropbox() {&lt;BR /&gt;
        AppKeyPair appKeys = new AppKeyPair(DROPBOX_APP_KEY, DROPBOX_APP_SECRET);&lt;BR /&gt;
        AndroidAuthSession session = new AndroidAuthSession(appKeys, DROPBOX_ACCESS_TYPE);&lt;BR /&gt;
        mDBApi = new DropboxAPI&amp;lt;AndroidAuthSession&amp;gt;(session);&lt;BR /&gt;
        //Create DropboxUtil class that will be used in this app's Javascript &lt;BR /&gt;
        DropboxUtils dropboxUtils = new DropboxUtils(this, appView);&lt;BR /&gt;
        appView.addJavascriptInterface(dropboxUtils, "DropboxUtils");&lt;/P&gt;

&lt;P&gt;I understand about the new key pairs.  Yes we have a separate key pair for each app.  Just to check the code,  I added the old key to the new code.  I am assume that there isn't other parameter that would change between key pairs.  If the code works with one set of keys, shouldn't it work with the other set.   I didn't know if new app required a different api level from the time we create the other app.  Nothing has changed in the code, but the keys.  &lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:38:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121786#M3544</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-27T00:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121787#M3545</link>
      <description>&lt;P&gt;Sorry I see in the Developer console were to generate the access token.  Does this need to be in the Android code?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 00:43:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121787#M3545</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-27T00:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: API Version</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121788#M3546</link>
      <description>&lt;P&gt;Thanks for your help.  Logcat show a error.  I was missing key in the Manifest file-  I am godod.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 01:00:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-Version/m-p/121788#M3546</guid>
      <dc:creator>David M.232</dc:creator>
      <dc:date>2015-03-27T01:00:44Z</dc:date>
    </item>
  </channel>
</rss>

