Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi all
I'm trying to access a folder outside of my personal root (a team folder).
if let client = DropboxClientsManager.authorizedClient?.withPathRoot(.namespaceId("12345678")) {
// do nothing
print("dropbox connected")
// client.users.getCurrentAccount().response(completionHandler: { user, error in
//
// print(user)
//
// let rootNamespaceId = user?.rootInfo.rootNamespaceId
//
// print(rootNamespaceId)
//
client.files.listFolder(path: "").response(completionHandler: { response, error in
if let result = response {
print(Thread.current)
print(Thread.main)
print(result)
} else if let err = error {
print(err)
}
})
}
I'm getting a «sessionDeinitialized» when I try to get the folder contents.
Without the «withPathRoot» everything works fine.
I get the namespaceId from the user info (the part that's commented out).
What am I doing wrong?
What am I doing wrong?
Note that the requests are performed asynchronously, and from the sessionDeinitialized error it sounds like your client object was released (and accordingly the underlying session was deinitialized) before the request could be completed; to fix that you'd need to update your code to keep that client object around while the request(s) complete.
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!