We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
H. Reo
11 years agoNew member | Level 1
SwiftyDropbox API Error
Hello!
I'm trying out SwiftyDropbox
I can get user's name (with usersGetCurrentAccount() )
but I can't get user's filesList(with filesListFolder(path: ""))
error message is 'Bad Input: Error in call to API function "files/list_folder": request body: could not decode input as JSON'
environment
Xcode7
Swift2.0
SwiftyDropbox branch 'swift-2.0'
18 Replies
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
Hi Michael, that's a known issue in version 2.0.3. Please use version 2.0.2 for now. You can find more information in this thread: https://www.dropboxforum.com/hc/en-us/community/posts/203941303-Swifty-SDK-Search-API-Error-on-v2-0-3
- Michael K.5710 years agoNew member | Level 1
1: Wow, that's one of the fastest responses I've ever rec'd... to anything!!
2: Thank you.
3: FWIW, all I had to do to fix it and clear the errors was to change line 177 in Client.swift from :
- let request = client.manager.request(.POST, url, parameters: [:], headers: headers, encoding: ParameterEncoding.Custom {(convertible, _) in
to: (Note "parameters"...)
- let request = client.manager.request(.POST, url, parameters: [":"], headers: headers, encoding: ParameterEncoding.Custom {(convertible, _) in After making that tiny little change, all is well!
- Liang M.10 years agoNew member | Level 1
Thanks Michael K..
Your tiny little change really works like a charm.
- Greg-DB10 years ago
Dropbox Community Moderator
For reference, that issue was fixed in release 3.0.0.
- Liang M.10 years agoNew member | Level 1
Thanks Gregory.
But I tested the demo app "Photo Watch" a few hours ago, and it does not include the fix using the following Podfile:
platform :ios, '8.0'
use_frameworks!
target 'PhotoWatch' do
pod 'SwiftyDropbox'
end
I am not familiar with CocoPods, and I presumed that "pod 'SwiftyDropbox'" refers to the master branch. But the pod installed still has the same issue, while the master has it fixed.
- Greg-DB10 years ago
Dropbox Community Moderator
The PhotoWatch sample app currently only has SwiftyDropbox 2.0.3 installed. You'd need to do a pod update to get the latest release with the fix.
- Liang M.10 years agoNew member | Level 1
Just tested it again.
pod 'SwiftyDropbox' will install SwiftyDropbox 2.0.3, which has the bug, while pod 'SwiftyDropbox', '~> 3.0.0' will install SwiftyDropbox 3.0.0.
- Leah C.110 years agoNew member | Level 1
Quick update - the PhotoWatch sample app has been updated to SwiftyDropbox 3.0.0 so this issue should be fixed now. Thanks for reporting the issue!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!