One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
petepete717
3 years agoHelpful | Level 6
Internal Server Error 500 when sharing folder
When running my code I can share a folder one or two times but then I receive the Internal Server Error 500 afterwards.
Creating the shared folder works:
client.sharing.shareFolder(path: pathName).response { launch, error in
switch launch {
case .complete(let launchData):
let id = launchData.sharedFolderID
-> Code for adding shared member called from here
shareFolder(id: id)
case .asyncJobId(let jobID):
// Do my async things here
}
case .none:
print("None")
}
}
func shareFolder(id: String) {
let member = Sharing.AddMember(member: .email("my.test@email.com))
client.sharing.addFolderMember(sharedFolderId: id,
members: [member],
quiet: false,
customMessage: "Welcome to EZfile!")
.response { _, error in
switch error {
case .none:
print("Success creating share")
case .some(let wrapped):
print("Sharing folder error: \(#function)", wrapped)
}
}
}
The folder is created (I see it in Dropbox) but the share does not work in 80% of the times. Which indicates that I am creating the client correctly.
What am I missing here?
- petepete717Helpful | Level 6
Here you go:
When I run
switch error {
case .internalServerError(let code, let message, let requestId):
print("InternalServerError[\(requestId)]: \(code): \(message)")
it prints
InternalServerError[nil]: 500: Optional("")
I also checked: The sharedFolderID is correct.
- Greg-DB
Dropbox Staff
Thanks for following up. Unfortunately it appears the request ID is not actually getting set there for some reason.
Can you confirm if you're performing these calls using an app owned by the Dropbox account you're using to post in the forum here? We can try to look up the failures that way instead.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 5 hours ago
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 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!