You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Bob S.15
8 years agoCollaborator | Level 9
migrating from API 1 to 2 - how do I know if I have OAuth 1 tokens?
I am finally getting around to updating my OLD apps from the original Dropbox IOS API to the new one. I'm looking at the migration guide, and the first thing it says is to check my OAuth tokens to see if they are version 1 or 2. How do I know which I have?
Also, the migration guide describes using the "endpoint" /oauth2/token_from_oauth1 to transition old tokens. So, I am coming to this from an ancient time -- what is an "endpoint", and is this 'token_from_oauth1' a function that you call from Objective-C in an iOS app? The documentation page I'm looking at only shows Python, Java, Ruby, and PHP examples, so maybe I'm not looking in the right place.
Is this where I should start? Is there a guide for upgrading an iOS app somewhere?
Also is this page current? It dates from March 2016, but then also there is a v1 deprecation warning at the top of it:
https://www.dropbox.com/developers-v1/core/sdks/ios
Thanks,
Bob
- Greg-DBDropbox StaffHi Bob, were you using an official API v1 Dropbox SDK, either the Core SDK or Sync SDK? If so, then yes, your app has OAuth 1 access tokens stored. (Both of those SDKs only used OAuth 1 access tokens.)
If you weren't using an official SDK, the easiest way to check is to see if your access tokens have two pieces (a key and secret) in which case they are OAuth 1 access tokens. If they're just one long string, they're OAuth 2 access tokens.
This old blog post has some helpful code for extracting those old access tokens:
https://blogs.dropbox.com/developers/2015/05/migrating-sync-sdk-access-tokens-to-core-sdk/
The API v2 equivalent of /1/oauth2/token_from_oauth1 is /2/auth/token/from_oauth1:
https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1
If you're using the API v2 Objective-C SDK, that's the -tokenFromOauth1:oauth1TokenSecret: method:
https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBAUTHRoutes.html#/c:objc(cs)DBAUTHRoutes(im)tokenFromOauth1:oauth1TokenSecret:- Bob S.15Collaborator | Level 9
Hey Greg,
My iOS project has a "DropboxSDK.framework" in it, which looks like it is from December 2014. So it is probably OAuth1.
So, where do I find the API v2 Objective-C SDK? Is that link at the end of my post the correct one?
Thanks
Bob
- Greg-DBDropbox StaffThe DropboxSDK.framework is the iOS Core SDK, which uses API v1 and OAuth 1 access tokens.
You can find the API v2 Objective-C SDK here:
https://www.dropbox.com/developers/documentation/objective-c
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!