We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

mattr's avatar
mattr
New member | Level 2
9 years ago

problem with single quote in api filepath

Hello, 

I am using a straightforward dropbox api call in Ruby to get a file's modifier email & display name, like so:

 

client = DropboxClient.new(generated_access_token)
root_metadata = client.metadata(dropbox_filepath)
user_email = root_metadata["modifier"]["email"]
user_name = root_metadata["modifier"]["display_name"]

 

However if the dropbox filepath includes a single quote, I haven't figured out how to escape it (I've tried %27, and various combos of backslashes and quote schemes).  Oddly, if I just remove the single-quote from the filepath entirely, the api works, but that would mean that the api can't tell the difference between files: Howre_you.doc and How're_you.doc.

 

Much obliged for any suggestions! 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    It looks like you're using the Dropbox API v1 Ruby SDK, so you don't need to do any escaping yourself. The SDK will take care of it.

    Also, the API can see the single quote character. I just tried it out and it's working properly for me. Is it possible you have the wrong path? Also, when looking at the response, make sure to check "is_deleted" so you know if you're looking at an active or deleted file, as well as the returned "path" field so you can confirm which file you're getting back while debugging this.

    If you're still having trouble, please share the values you're using and the output you're getting and we'll be happy to look into it.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 3 hours ago
325 Following

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!