Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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'
UPDATE:
I applied the fix that was suggested in "#48" by Leshkoapps and it solved the problem. I'm not sure why the version that I installed via cocoapods didn't include this change, but I'm a bit of a noob to cocoapods and programming in general, so it was likely a user mistake, but in case someone else makes the same one...
Hi,
I'm getting this error as well, using nothing more than the sample code in the tutorial to get up and running. It does seem to be writing and reading the "hello.txt" file, but I get this:
*** Get current account ***
[request-id 2d1753ef779bb8bb8631124239e00f4e] Bad Input: Error in call to API function "users/get_current_account": request body: could not decode input as JSON
*** List folder ***
[request-id 4a7934fec1ed93d70f3f049913ee9280] Bad Input: Error in call to API function "files/list_folder": request body: could not decode input as JSON
*** Upload file ****
Uploaded file name: hello.txt
Uploaded file revision: 242d57873
*** Get file metadata ***
[request-id 82d1fb27eee8bccceb2f749b46b614b0] Bad Input: Error in call to API function "files/get_metadata": request body: could not decode input as JSON
*** Download file ***
Downloaded file name: hello.txt
Downloaded file url: file:///var/mobile/Containers/Data/Application/68429947-9A4F-4C67-89A0-EE5CCBB02BC7/Documents/C1E5D3F0-2A11-499D-A98D-9F3EACCE69FA-download.txt
Downloaded file data: Optional(<48656c6c 6f21>)
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-...
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"...)
|
|||
Thanks Michael K..
Your tiny little change really works like a charm.
For reference, that issue was fixed in release 3.0.0.
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.
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.
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.
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!
Hi there!
If you need more help you can view your support options (expected response time for a 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!