cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Where should I see the "v1_retired" error ?

Explorer | Level 3

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
Highlighted

Re: Where should I see the "v1_retired" error ?

Dropboxer
Dropboxer
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
Highlighted

Re: Where should I see the "v1_retired" error ?

Dropboxer
Dropboxer
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

Highlighted

Re: Where should I see the "v1_retired" error ?

Explorer | Level 3

Thanks very much!

 

It looks like you gave me some good starting points.

 

I will check it.

 

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?