Programmatically obtain Dropbox share link

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Programmatically obtain Dropbox share link

Post by bifjamod »

When accessing the right-click context menu in XYPlorer, it is possible to obtain the URL for a Dropbox file, so that it can be shared ("Copy Dropbox Link.") My need is to programmatically obtain that link, rather than obtaining it manually. I do not have sufficient knowledge (nor the time to invest in gaining that knowledge) to develop something through the Dropbox API that would allow me to do this. Since XYPlorer already does it, my question is this:
Is there a way I can call XYPlorer to obtain the link?
I already know the "internal" path of the file in question (c:\Dropbox\Files\Doc1.pdf). It seems to be there should be a way to have (preferably) VBA call XYPlorer, pull the Dropbox link, and return the link to clipboard control. Can anyone offer some insight into how I might do this?

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Programmatically obtain Dropbox share link

Post by highend »

Afaik: Not possible

1. XY isn't involved in any way. The context menu that creates this link is done solely through the dropbox software
2. Dropbox's API doesn't provide a method to get this public link

The linux version has a cli script (.py) which has an argument "puburl" but I guess it's outdated (and I didn't try if it still works):

Code: Select all

    try:
        with closing(DropboxCommand()) as dc:
            try:
                console_print(dc.get_public_link(path=unicode_abspath(args[0].decode(sys.getfilesystemencoding()))).get(u'link', [u'No Link'])[0])
this get_public_link() method doesn't seem to exist anymore
One of my scripts helped you out? Please donate via Paypal

bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Re: Programmatically obtain Dropbox share link

Post by bifjamod »

Thank you highend; I did not realize the context menu functionality originated from the Dropbox app itself.

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Programmatically obtain Dropbox share link

Post by highend »

Actually, it is possible...

The current api provides:
sharing_create_shared_link_with_settings
and
sharing_get_shared_links

so this could be done e.g. via a python script (or any other language that supports the dropbox api, e.g. javascript)

by:
- checking if there are shared files
- if the specific file isn't shared yet, share it, copy the link to the clipboard
- if it's shared get it's url and copy it to the clipboard
One of my scripts helped you out? Please donate via Paypal

bifjamod
Posts: 9
Joined: 01 Oct 2015 03:06

Re: Programmatically obtain Dropbox share link

Post by bifjamod »

Hmmm, keeping the dream alive! Pretty much anything outside of VBA is outside my skillset, but I'm asking a guy I know to see if he can help me work that out via VBA anyway. My thinking is it may be possible to call Javascript from VBA.

Post Reply