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: 

how to port getFileStream to V2

how to port getFileStream to V2

Qbert
Explorer | Level 3
Go to solution

Hi there,

When running my Android app I now get the error message that v1 is depricated when executing getFileStream.

Error: "DropboxServerException (nginx): 400 Bad Request (v1_retired)"

Unfortunetely I can not get my head around a possible migration or fix.

I do not seem to use any of the things mentioned in the migration guide.

The examples all use completely different ways to implement the authentication procedure.

Do I have to install a new SDK?

Do I have to change the way I authenticate?

Or do I have to change the call to the API.

The authentication seems ok, as I get a DropboxApi object.

Any help is appreciated.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

API v2 does offer a different interface than API v1, so you will need to update your SDK and code.

 

For 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

 

There's an example of downloading here:

 

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

 

By the way, if you need more time to migrate your app to API v2, we can offer an extension for access to API v1. To request that, please open an API ticket with the relevant app key(s):

 

https://www.dropbox.com/developers/contact

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

API v2 does offer a different interface than API v1, so you will need to update your SDK and code.

 

For 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

 

There's an example of downloading here:

 

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

 

By the way, if you need more time to migrate your app to API v2, we can offer an extension for access to API v1. To request that, please open an API ticket with the relevant app key(s):

 

https://www.dropbox.com/developers/contact

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?