<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get Shared Link of uploaded file programatically in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-Shared-Link-of-uploaded-file-programatically/m-p/252241#M14540</link>
    <description>&lt;P&gt;I can use this code to upload my file to the dropbox through html.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;function handleFileSelect(evt) {
        var files = evt.target.files; // FileList object
        
        ////  files is a FileList of File objects
        for (var i = 0, f; f = files[i]; i++) {
            $.ajax({
                url: 'https://content.dropboxapi.com/2/files/upload',
                type: 'post',
                data: f,
                processData: false,
                contentType: 'application/octet-stream',
                
                headers: {
                    "Authorization": "Bearer &amp;lt;REDACTED&amp;gt;",
                    "Dropbox-API-Arg": '{"path": "/' + f.name + '","mode": "add"}'
                },
                
                success: function (data) {
                    console.log(data);
                },
                        
                error: function (data) {
                    console.log(data);
                }
            })
        }
    }
document.getElementById('files').addEventListener('change', handleFileSelect, false);&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;However, I would like to get the shared link of the uploaded file. I tried this code but couldn't get it.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;
        function handleSharedLink(evt) {
            var path = "TARCpace.apk";

            $http.post("https://api.dropboxapi.com/2/sharing/get_shared_links",
                JSON.stringify({
                    "path": path
                }),
                {
                    headers: {
                        'Content-Type': "application/json",
                        'Authorization': "Bearer &amp;lt;REDACTED&amp;gt;"
                    }
                }
            ).then(function (data) {
                    console.log(data);
                    $('#output').html(result);
            })
        }

 
  var output = document.getElementById('getlink').addEventListener('click', handleSharedLink, false);
&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;How can i get the shared link? Is the method correct?&lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2020 17:15:01 GMT</pubDate>
    <dc:creator>fann_96</dc:creator>
    <dc:date>2020-05-29T17:15:01Z</dc:date>
    <item>
      <title>Get Shared Link of uploaded file programatically</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-Shared-Link-of-uploaded-file-programatically/m-p/252241#M14540</link>
      <description>&lt;P&gt;I can use this code to upload my file to the dropbox through html.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;function handleFileSelect(evt) {
        var files = evt.target.files; // FileList object
        
        ////  files is a FileList of File objects
        for (var i = 0, f; f = files[i]; i++) {
            $.ajax({
                url: 'https://content.dropboxapi.com/2/files/upload',
                type: 'post',
                data: f,
                processData: false,
                contentType: 'application/octet-stream',
                
                headers: {
                    "Authorization": "Bearer &amp;lt;REDACTED&amp;gt;",
                    "Dropbox-API-Arg": '{"path": "/' + f.name + '","mode": "add"}'
                },
                
                success: function (data) {
                    console.log(data);
                },
                        
                error: function (data) {
                    console.log(data);
                }
            })
        }
    }
document.getElementById('files').addEventListener('change', handleFileSelect, false);&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;However, I would like to get the shared link of the uploaded file. I tried this code but couldn't get it.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;
        function handleSharedLink(evt) {
            var path = "TARCpace.apk";

            $http.post("https://api.dropboxapi.com/2/sharing/get_shared_links",
                JSON.stringify({
                    "path": path
                }),
                {
                    headers: {
                        'Content-Type': "application/json",
                        'Authorization': "Bearer &amp;lt;REDACTED&amp;gt;"
                    }
                }
            ).then(function (data) {
                    console.log(data);
                    $('#output').html(result);
            })
        }

 
  var output = document.getElementById('getlink').addEventListener('click', handleSharedLink, false);
&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;How can i get the shared link? Is the method correct?&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 17:15:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-Shared-Link-of-uploaded-file-programatically/m-p/252241#M14540</guid>
      <dc:creator>fann_96</dc:creator>
      <dc:date>2020-05-29T17:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get Shared Link of uploaded file programatically</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-Shared-Link-of-uploaded-file-programatically/m-p/252394#M14546</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/47237857/get-dropbox-shared-link-after-uploaded-a-file-programatically" target="_blank"&gt;https://stackoverflow.com/questions/47237857/get-dropbox-shared-link-after-uploaded-a-file-programatically&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to retrieve existing shared links, you should use &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links" target="_self"&gt;/2/sharing/list_shared_links&lt;/A&gt;. (The&amp;nbsp;/2/sharing/get_shared_links endpoint also technically works, but it is deprecated.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to create a new one, you should use &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings" target="_self"&gt;/2/sharing/create_shared_link_with_settings&lt;/A&gt;. (For reference, your StackOverflow post used&amp;nbsp;/2/files/get_temporary_link, which is&amp;nbsp;also fine if that's what you want. That will give you a temporary direct link to the file that expires after four hours.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, you posted your access token. I redacted it, but for the sake of security, you should disable that access token. You can do so by revoking access to the app entirely, if the access token is for your account, on &lt;A href="https://www.dropbox.com/account/security" target="_self"&gt;the connected apps page&lt;/A&gt;. Or, you can disable just this access token using &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke" target="_self"&gt;the&amp;nbsp;/2/auth/token/revoke endpoint&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:00:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-Shared-Link-of-uploaded-file-programatically/m-p/252394#M14546</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-13T17:00:10Z</dc:date>
    </item>
  </channel>
</rss>

