I have the following code which I modified slightly from this link. 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."
Can someone provide some direction that might help?
Dim req As MSXML2.ServerXMLHTTP60
Set req = New MSXML2.ServerXMLHTTP60
Dim arg As String
Dim filename As String
Dim path As String
Dim Result As String
path = "Desktop Work File"
filename = "33602DOX.pdf"
arg = "{""path"": ""/" & filename & """}"
req.Open "POST", "https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings", False
req.setRequestHeader "Authorization", "Bearer XXXXXXXXXX"
req.setRequestHeader "Content-Type", "application/json"
req.Send arg
If req.Status = 200 Then
Debug.Print req.responseText
Else
MsgBox req.Status & ": " & req.StatusText
Debug.Print req.responseText
End If