<?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: SwiftyDropbox createSharedLinkWithSettings (was createSharedLink) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220320#M11657</link>
    <description>&lt;P&gt;Yes, I thought so, but then I need another round-trip and I have to parse the response searching for my file and bother with cursor...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you add a convenience method to work like the old createSharedLink, please ?&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2017 20:38:31 GMT</pubDate>
    <dc:creator>larschassing</dc:creator>
    <dc:date>2017-05-09T20:38:31Z</dc:date>
    <item>
      <title>SwiftyDropbox createSharedLinkWithSettings (was createSharedLink)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220290#M11654</link>
      <description>&lt;P&gt;Googling around led me to&amp;nbsp;cocoadocs.org which seems to have an older version of SwiftyDropbox. It has&amp;nbsp;&lt;SPAN&gt;createSharedLink(path:shortUrl:pendingUpload:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Create a shared link. If a shared link already exists for the given path, that link is returned."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;which is exactly what I want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://cocoadocs.org/docsets/SwiftyDropbox/1.0/Classes/SharingRoutes.html#/s:FC13SwiftyDropbox13SharingRoutes16createSharedLinkFS0_FT4pathSS8shortUrlSb13pendingUploadGSqOCS_7Sharing17PendingUploadMode__GCS_15BabelRpcRequestCS1_26PathLinkMetadataSerializerCS1_31CreateSharedLinkErrorSerializer_" target="_blank"&gt;http://cocoadocs.org/docsets/SwiftyDropbox/1.0/Classes/SharingRoutes.html#/s:FC13SwiftyDropbox13SharingRoutes16createSharedLinkFS0_FT4pathSS8shortUrlSb13pendingUploadGSqOCS_7Sharing17PendingUploadMode__GCS_15BabelRpcRequestCS1_26PathLinkMetadataSerializerCS1_31CreateSharedLinkErrorSerializer_&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, now I can only find&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;createSharedLinkWithSettings(path:&amp;nbsp;String,&amp;nbsp;settings:&amp;nbsp;Sharing.SharedLinkSettings?&amp;nbsp;=&amp;nbsp;nil)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;that&amp;nbsp;may return&amp;nbsp;sharedLinkAlreadyExists, which isn't exactly useful.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;OK, so the link already exists, but what IS the SharedLink url then ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How&amp;nbsp;do I find it ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Why did you ditch the old pragmatic&amp;nbsp;createSharedLink that simply returned the SharedLink url in any case ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:22:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220290#M11654</guid>
      <dc:creator>larschassing</dc:creator>
      <dc:date>2019-05-29T09:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox createSharedLinkWithSettings (was createSharedLink)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220318#M11656</link>
      <description>&lt;P&gt;The official documentation for the sharing routes for the latest version of SwiftyDropbox can be found be found &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/SharingRoutes.html" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;createSharedLink method was deprecated in favor of &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/SharingRoutes.html#/s:FC13SwiftyDropbox13SharingRoutes28createSharedLinkWithSettingsFT4pathSS8settingsGSqCCS_7Sharing18SharedLinkSettings__GCS_10RpcRequestCS1_28SharedLinkMetadataSerializerCS1_43CreateSharedLinkWithSettingsErrorSerializer_" target="_self"&gt;createSharedLinkWithSettings&lt;/A&gt;&amp;nbsp;to match updates to the&amp;nbsp;Dropbox product itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a link already exists, you can retrieve it using &lt;A href="https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/SharingRoutes.html#/s:FC13SwiftyDropbox13SharingRoutes15listSharedLinksFT4pathGSqSS_6cursorGSqSS_10directOnlyGSqSb__GCS_10RpcRequestCCS_7Sharing31ListSharedLinksResultSerializerCS2_30ListSharedLinksErrorSerializer_" target="_self"&gt;listSharedLinks&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 20:29:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220318#M11656</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-05-09T20:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox createSharedLinkWithSettings (was createSharedLink)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220320#M11657</link>
      <description>&lt;P&gt;Yes, I thought so, but then I need another round-trip and I have to parse the response searching for my file and bother with cursor...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you add a convenience method to work like the old createSharedLink, please ?&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 20:38:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220320#M11657</guid>
      <dc:creator>larschassing</dc:creator>
      <dc:date>2017-05-09T20:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox createSharedLinkWithSettings (was createSharedLink)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220322#M11658</link>
      <description>I can't make any promises as to if or when that would be added, but I'm sending that along as a feature request.</description>
      <pubDate>Tue, 09 May 2017 20:39:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220322#M11658</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-05-09T20:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: SwiftyDropbox createSharedLinkWithSettings (was createSharedLink)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220337#M11661</link>
      <description>&lt;P&gt;When I looked closer at listSharedLinks I noted the path and directOnly arguments, that helped.&lt;/P&gt;
&lt;P&gt;This is what I ended up with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;func OldCreateSharedLink(url: URL, dropboxPath: String, completionHandler: @escaping (_ sharedLink: String) -&amp;gt; Void) {
   if let client = DropboxClientsManager.authorizedClient {
      let request = client.sharing.createSharedLinkWithSettings(path: dropboxPath)
         .response { response, error in
            if let response = response {
               print(response)
               completionHandler(response.url)
            } else if let error = error {
               print(error)
               switch error as CallError {
               case .routeError(let boxed, let requestId):
                  print("RouteError[\(String(describing: requestId))]:")
                  switch boxed.unboxed as Sharing.CreateSharedLinkWithSettingsError {
                  case .sharedLinkAlreadyExists:
                     let request2 = client.sharing.listSharedLinks(path: dropboxPath, cursor: nil, directOnly: true)
                        .response { response, error in
                           if let response = response {
                              print(response)
                              if let theFirstTheBest = response.links.first {
                                 completionHandler(theFirstTheBest.url)
                              }
                           } else if let error = error {
                              print(error)
                           }
                     }
                     print(request2)
                  default:
                     print("\(boxed.unboxed)")
                  }
               default:
                  break
               }
            }
      }
      print(request)
   }
}&lt;/PRE&gt;
&lt;P&gt;Thank you for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 21:47:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/SwiftyDropbox-createSharedLinkWithSettings-was-createSharedLink/m-p/220337#M11661</guid>
      <dc:creator>larschassing</dc:creator>
      <dc:date>2017-05-09T21:47:36Z</dc:date>
    </item>
  </channel>
</rss>

