<?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 Re: Obtaining shared link from VBA (API v2) - 409 Conflict in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189288#M8094</link>
    <description>&lt;P&gt;Bob, I redacted that access token for you, but you should &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke" target="_blank" rel="nofollow noreferrer"&gt;revoke&lt;/A&gt; it to be safe.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2016 01:56:58 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-09-15T01:56:58Z</dc:date>
    <item>
      <title>Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189281#M8087</link>
      <description>&lt;P&gt;I have the following code which I modified slightly from this &lt;A href="https://www.dropboxforum.com/hc/en-us/community/posts/210733166-Converting-from-V1-to-V2" target="_blank" rel="nofollow noreferrer"&gt;link&lt;/A&gt;. The return is a 409 Conflict error. I believe the issue lies in how I'm structuring the path string, but I admit to this being well beyond my limited VBA programming skills (more of "mosh thing together until they work skills."&lt;/P&gt;
&lt;P&gt;Can someone provide some direction that might help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim req As MSXML2.ServerXMLHTTP60&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set req = New MSXML2.ServerXMLHTTP60&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim arg As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim filename As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = "Desktop Work File"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = "33602DOX.pdf"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arg = "{""path"": ""/" &amp;amp; filename &amp;amp; """}"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.Open "POST", "&lt;A href="https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings&lt;/A&gt;", False&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.setRequestHeader "Authorization", "Bearer XXXXXXXXXX"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.setRequestHeader "Content-Type", "application/json"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.Send arg&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If req.Status = 200 Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print req.responseText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox req.Status &amp;amp; ": " &amp;amp; req.StatusText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print req.responseText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:30:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189281#M8087</guid>
      <dc:creator>Bob D.20</dc:creator>
      <dc:date>2019-05-29T09:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189282#M8088</link>
      <description>&lt;P&gt;What's in the response body? It should contain a specific error indicating the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 07:18:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189282#M8088</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-09-14T07:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189283#M8089</link>
      <description>&lt;P&gt;This is what is showing up in the Immediate window of my VBA editor after I accept the 409 message:&lt;/P&gt;
&lt;P&gt;{"error_summary": "path/not_found/..", "error": {".tag": "path", "path": {".tag": "not_found"}}}&lt;/P&gt;
&lt;P&gt;That seems to substantiate my thought that the path structure is wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 07:35:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189283#M8089</guid>
      <dc:creator>Bob D.20</dc:creator>
      <dc:date>2016-09-14T07:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189284#M8090</link>
      <description>&lt;P&gt;That's correct, a path/not_found error from&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings" target="_blank" rel="nofollow noreferrer"&gt;/2/sharing/create_shared_link_with_settings&lt;/A&gt;&amp;nbsp;indicates "there is nothing at the given path".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You gave the path "/33602DOX.pdf", so there must not be anything at that path in the account you're calling for. For example, if the file is inside a folder called "Documents", you should supply the path "/Documents/33602DOX.pdf".&lt;/P&gt;
&lt;P&gt;(I also don't see you using your "path" variable, with value "Desktop Work File". Should that be part of the path?)&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 08:47:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189284#M8090</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-09-14T08:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189285#M8091</link>
      <description>&lt;P&gt;The file does exist at Desktop Work File/33602DOX.pdf.&lt;/P&gt;
&lt;P&gt;In the code line "arg = "{"path": "/" &amp;amp; filename &amp;amp; "}", I assumed path to be the folder string, and filename to be the document string. However, upon further review of the API documentation, I see that is a misunderstanding. I worked the script a bit, but still produce the same error.&lt;/P&gt;
&lt;P&gt;Here is the sample &lt;EM&gt;arg&lt;/EM&gt; line from the API doc: &lt;EM&gt; {"path": "/Prime_Numbers.txt"}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Here is the line I am passing in my &lt;EM&gt;arg&lt;/EM&gt;: &lt;EM&gt;{"path": "/Desktop Work File/33602DOX.pdf"}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I'm not seeing why my arg is not working...it appears functionally identical to the sample, but clearly is not.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Please understand - I am not a programmer or IT specialist; this is a tool I am trying to use to improve my workflow, and I do not fully understand it. Can you help me understand how I should be structuring the arg message? I realize VBA may not be your forte, but if I can come to an understanding on the proper structure that I'm supposed to be sending, I should be able to make it work in VBA. (I've reviewed the API documentation, but I don't understand a lot of that without full-blown samples to experiment with - which is where the original script I linked to comes in....)&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 19:55:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189285#M8091</guid>
      <dc:creator>Bob D.20</dc:creator>
      <dc:date>2016-09-14T19:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189286#M8092</link>
      <description>&lt;P&gt;When supplying the path argument for the file, you do need to supply the full path, including any parent folders. In the sample, the file was presumed to be in the root, but for your case you would need to supply the full "/Desktop Work File/33602DOX.pdf".&lt;/P&gt;
&lt;P&gt;Your original code was:&lt;/P&gt;
&lt;P&gt;arg = "{"path": "/" &amp;amp; filename &amp;amp; "}"&lt;/P&gt;
&lt;P&gt;So, that would need to be something like:&lt;/P&gt;
&lt;P&gt;arg = "{"path": "/" &amp;amp; path &amp;amp; "/" &amp;amp; filename &amp;amp; "}"&lt;/P&gt;
&lt;P&gt;That should work out to what you have in your followup:&lt;/P&gt;
&lt;P&gt;{"path": "/Desktop Work File/33602DOX.pdf"}&lt;/P&gt;
&lt;P&gt;Is that also giving the same exact "path/not_found" error? (There are other kinds of path errors.) You should&amp;nbsp;also make sure you're connected to the account you intend.&lt;/P&gt;
&lt;P&gt;You can use&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account" target="_blank" rel="nofollow noreferrer"&gt;/2/users/get_current_account&lt;/A&gt;&amp;nbsp;to check the account. You can use&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder" target="_blank" rel="nofollow noreferrer"&gt;/2/files/list_folder&lt;/A&gt;[&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue" target="_blank" rel="nofollow noreferrer"&gt;/continue&lt;/A&gt;] to list the contents of a folder. The &lt;A href="https://dropbox.github.io/dropbox-api-v2-explorer/" target="_blank" rel="nofollow noreferrer"&gt;API Explorer&lt;/A&gt; is also a good way to try out the API.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 23:38:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189286#M8092</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-09-14T23:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189287#M8093</link>
      <description>&lt;P&gt;Thank you! The clue was in "make sure you're connected to the account you intend." I was, but my app was set for it's own folder, not all of my DB account!&lt;/P&gt;
&lt;P&gt;Rectified that, and completed as successful share link retrieval!&lt;/P&gt;
&lt;P&gt;For anyone that needs it, here's the final script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim req As MSXML2.ServerXMLHTTP60&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set req = New MSXML2.ServerXMLHTTP60&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim arg As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim filename As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As String&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = "Desktop Work File"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = "33603DOX.pdf"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arg = "{"path": "/" &amp;amp; path &amp;amp; "/" &amp;amp; filename &amp;amp; "}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.Open "POST", "&lt;A href="https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings" rel="nofollow noreferrer"&gt;https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings&lt;/A&gt;", False&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.setRequestHeader "Authorization", "Bearer &amp;lt;redacted&amp;gt;"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.setRequestHeader "Content-Type", "application/json"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.Send arg&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If req.Status = 200 Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print req.responseText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox req.Status &amp;amp; ": " &amp;amp; req.StatusText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print req.responseText&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 01:55:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189287#M8093</guid>
      <dc:creator>Bob D.20</dc:creator>
      <dc:date>2016-09-15T01:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189288#M8094</link>
      <description>&lt;P&gt;Bob, I redacted that access token for you, but you should &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke" target="_blank" rel="nofollow noreferrer"&gt;revoke&lt;/A&gt; it to be safe.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 01:56:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189288#M8094</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-09-15T01:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Obtaining shared link from VBA (API v2) - 409 Conflict</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189289#M8095</link>
      <description>&lt;P&gt;Thank you...can't believe I forgot to take that out! Taking your advice right now.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 01:57:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Obtaining-shared-link-from-VBA-API-v2-409-Conflict/m-p/189289#M8095</guid>
      <dc:creator>Bob D.20</dc:creator>
      <dc:date>2016-09-15T01:57:50Z</dc:date>
    </item>
  </channel>
</rss>

