title: How to download image from dropbox without using api in iOS swift
body: <p>This is the http request from dropbox api explorer for Dropbox API Explorer • download</p>
  
  <pre><code>POST /2/files/download
  Host: https://content.dropboxapi.com
  User-Agent: api-explorer-client
  Authorization: ACCESS-TOKEN
  Dropbox-API-Arg: {"path":"image.jpg"}
  </code></pre>
  
  <p>I created a Alamofire request to download but it doesn't work</p>
  
  <p>But when I create a Temporary Link and try to download it works.</p>
  
  <p>Code for temp link download (working)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>let parameters: Parameters = [
              "path": requestedFilePath
          ]
          
          let urlString = AjaxRequestUrlList.getDropBoxTempLink
          Alamofire.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default, headers: dropboxHeaderWithContentTypeJSON)
              .LogRequest()
              .responseJSON { response in
                  if !response.result.isFailure{
                      var json = JSON(response.result.value!)
                      if json["link"].exists(){
                              Alamofire.download(json["link"].string!, to: destination).responseData { response in
                                  if completionHandler != nil{
                                      completionHandler(true)
                                  }
                          }
                      }
                      else{
                          if completionHandler != nil{
                              completionHandler(false)
                          }
                      }
                  }
                  else{
                          if completionHandler != nil{
                          completionHandler(false)
                      }
                  }
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>let dropboxHeaderWithContentTypeJSON: HTTPHeaders = [
      "Authorization": CS_App_Constants.dropboxAccessToken,
      "Content-Type" : "application/json"
      ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>But if I directly call <a href="https://content.dropboxapi.com/2/files/download" rel="nofollow noreferrer">https://content.dropboxapi.com/2/files/download</a> without getting temp link it fails </p>