Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am facing below error when I am trying to list folder or get current account info. Please help
Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api.dropbox.com/2/users/get_current_account, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://api.dropbox.com/2/users/get_current_account}
Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://api.dropbox.com/2/files/list_folder, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://api.dropbox.com/2/files/list_folder}
Below the code I have tried.
let client = DropboxClient(accessToken: "MYTOKEN")
client.users.getCurrentAccount().response { (response, error) in
if let result = response {
print(result)
} else if let error = error {
print(error)
}
}
client.files.listFolder(path: "").response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error in
if let result = response {
print(Thread.current) // Output: <NSThread: 0x61000007bec0>{number = 4, name = (null)}
print(Thread.main) // Output: <NSThread: 0x608000070100>{number = 1, name = (null)}
print(result)
} else if let error = error {
print(error)
}
}
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!