We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
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 se...
Greg-DB
8 years agoDropbox Staff
Hi 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:
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.158 years agoCollaborator | 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-DB8 years agoDropbox 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 - Bob S.158 years agoCollaborator | Level 9
OK thanks -- it says the minimum OS version is iOS 8. Does that mean Dropbox support is going to end for iOS7 devices in June? I'm still supporting older OS versions -- is there a way to use Dropbox API v2 and still do that?
Thanks
Bob
- Greg-DB8 years agoDropbox Staff
The API v2 Objective-C SDK itself supports iOS 8+. If you need to support older versions of iOS, you can either fork the SDK and make the necessary modifications for your use case, or call the HTTP interface for API v2 directly without using the SDK.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months 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!