cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where should I see the "v1_retired" error ?

Where should I see the "v1_retired" error ?

Dolphin_2018
Explorer | Level 4
Go to solution

Hi again,

 

Sorry if it's a stupid question but where exactly should I see the "v1_retired" error? Here is the part of my code where I'm trying to upload a file into the DropBox folder:

 

 

try 
{
    if (!dbxFs.exists(testPath))
    {
        testFile = dbxFs.create(testPath);
    	testFile.writeFromExistingFile(file, false);
    	testFile.close();
    }
}

catch (DbxException.Request e)
{
 e.printStackTrace();
 return false;
}

catch (DbxException.Disallowed e)
{
 e.printStackTrace();
 return false;
} catch (DbxException.Unauthorized e) { e.printStackTrace(); return false; } catch (DbxException.NotFound e) { e.printStackTrace(); return false; } catch (DbxException e) { e.printStackTrace(); return false; } catch (IOException e) { e.printStackTrace(); return false; }

 

 

but I'm not getting any exception, is this where I should get the error? in which of the exceptions should it accord?

 

Thanks.

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
It looks like you're trying to use the old API v1 Sync SDK for Android. That does use API v1, so API calls made by it will fail now. I don't have an example available of exactly how they would fail though. (The Sync SDK had some offline and retrying functionality built in, so the failure may not be immediately obvious anyway.)

In any case, you should migrate to API v2. For using API v2 from Android, we recommend using the official Dropbox API v2 Java SDK:

https://github.com/dropbox/dropbox-sdk-java

There's an example Android app here:

https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android

Your AndroidManifest.xml should be set up as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/AndroidManifest.xm...

You start the flow by calling startOAuth2Authentication as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

You complete the flow by calling getOAuth2Token as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

Your app can store and re-use the resulting access token for that user, as the example does here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

Once you have an access token, you can make a client as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/395d463840778b4c6ec730aef82b0a9dbee10f8e/examples/a...

With a client, you can make whatever calls you want, as shown in the readme and examples:

https://github.com/dropbox/dropbox-sdk-java/blob/master/ReadMe.md#try-some-api-requests

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution
It looks like you're trying to use the old API v1 Sync SDK for Android. That does use API v1, so API calls made by it will fail now. I don't have an example available of exactly how they would fail though. (The Sync SDK had some offline and retrying functionality built in, so the failure may not be immediately obvious anyway.)

In any case, you should migrate to API v2. For using API v2 from Android, we recommend using the official Dropbox API v2 Java SDK:

https://github.com/dropbox/dropbox-sdk-java

There's an example Android app here:

https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android

Your AndroidManifest.xml should be set up as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/AndroidManifest.xm...

You start the flow by calling startOAuth2Authentication as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

You complete the flow by calling getOAuth2Token as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

Your app can store and re-use the resulting access token for that user, as the example does here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/c...

Once you have an access token, you can make a client as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/395d463840778b4c6ec730aef82b0a9dbee10f8e/examples/a...

With a client, you can make whatever calls you want, as shown in the readme and examples:

https://github.com/dropbox/dropbox-sdk-java/blob/master/ReadMe.md#try-some-api-requests

Dolphin_2018
Explorer | Level 4
Go to solution

Thanks very much!

 

It looks like you gave me some good starting points.

 

I will check it.

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Dolphin_2018 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?