Can't Save to Dropbox

I have several 1 step actions that save a note to a specific folder in Dropbox and then archive the note. They have worked flawlessly since I got Drafts 5, but in the last few days none of them have worked at all. When I go into the Action Log for a note that I’ve run the action on the message says:

“The operation couldn’t be completed.
(OAuthSwiftError error -11)”

Is anyone else seeing this issue? Does anyone have any idea what might be going wrong here? Or what I should try to fix it? I tried googling it and I can’t seem to find anything related to this particular issue out there. Any help is appreciated. Thanks!

It is most likely expired/bad authentication. Maybe you did something at Dropbox that invalidated your token (like change password, or such).

Go to Settings > Credentials and “Forget” the Dropbox credentials - then try again. You’ll go through the re-authorization process and it will more than likely be fine after that.

I actually tried that (should have mentioned it in my first post), and it did not fix the issue. I just tried it again to double check and I am still getting the same error.

Is it specific to a certain draft? Possibly bad characters in the text causing errors.

Do actions to other folders and/or the default “Save to Dropbox” actions work? Possible it’s specific to the permissions on the specific folder or similar.

Figured it out. As expected, it was something really simple and dumb. I was trying to name the file based on the first line of the draft. But I didn’t have any returns in this particular draft. So it was trying to make a file with a 1200ish character name. I am assuming that is the problem because when I changed the first line to be a little shorter, it saved just fine. Thanks for the help!

Cool. Glad it’s sorted. I’ll review that case and try to get a more informative error message in there.

I have the same issue – saving a draft into Dropbox, I get the error

The operation couldn’t be completed. (OAuthSwiftError error -11.)

I believe the filename generated is too long. Even when using the [[safe_title]] tag I will get this error if there is additional text/tags before the safe_title tag.

For example, I use the following to generate a name [[modified|%Y%m%d%H%M]] [[safe_title]].txt and I still get the error until I shorten the first line to something much shorter (I’m guessing < 256 characters).

Update – I emailed the developer and the following solution worked for me:

It is possible to truncate a filename with script, but I don’t think it’s something the app should do by default - because there are many users who would prefer to get an error in that case.

If you want to modify your action to ensure you are within Dropbox’s limits, you could add a script step like:

// make the file name based on template
let fileName = draft.processTemplate("[[modified|%Y%m%d%H%M]] [[safe_title]]");
let limit = 250;
// if it's too long, truncate it
if (fileName.length > limit) {
   fileName = fileName.substring(0, limit);
// create a tag to use in Dropbox step
draft.setTemplateTag("filename", fileName);

Then, in the Dropbox step after this script step, use [[filename]].txt as your filename template.

And change [[modified|%Y%m%d%H%M]] [[safe_title]] as needed.