<?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: Issue in get preview api v2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-get-preview-api-v2/m-p/288793#M17684</link>
    <description>&lt;P&gt;This error message is indicating that you're supply a request body with this API call, but the API expects the request body to be empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's expected per the documentation for&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview" target="_blank"&gt;/2/files/get_preview&lt;/A&gt;, which indicates that it's a &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_blank"&gt;"Content-download" style endpoint&lt;/A&gt;. The documentation there covers this in more detail, but in short, you should be sending the API call parameters in a 'Dropbox-API-Arg' header, not the request body.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fix this, update your code to send the parameters in&amp;nbsp;a 'Dropbox-API-Arg' header, instead of in the request body, as you're currently doing with 'CURLOPT_POSTFIELDS'.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 15:07:22 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-08-03T15:07:22Z</dc:date>
    <item>
      <title>Issue in get preview api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-get-preview-api-v2/m-p/288730#M17682</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Error in call to API function "files/get_preview": The request body is supposed to be empty, but it isn't; got "{\"path\":\"\\/2019_DB\\/Copies\\/A123\\/NEW\\/21004_1910036125.pdf\"}"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$ch = curl_init();&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $auth_token, "Content-Type : application/x-www-form-urlencoded"));&lt;BR /&gt;//curl_setopt($ch, CURLOPT_URL, "&lt;A href="https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings" target="_blank"&gt;https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings&lt;/A&gt;");&lt;BR /&gt;//curl_setopt($ch, CURLOPT_URL, "&lt;A href="https://api.dropboxapi.com/2/files/get_temporary_link" target="_blank"&gt;https://api.dropboxapi.com/2/files/get_temporary_link&lt;/A&gt;");&lt;BR /&gt;curl_setopt($ch, CURLOPT_URL, "&lt;A href="https://content.dropboxapi.com/2/files/get_preview" target="_blank"&gt;https://content.dropboxapi.com/2/files/get_preview&lt;/A&gt;");&lt;BR /&gt;curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('path'=&amp;gt; $file_path)));&lt;BR /&gt;$result = curl_exec($ch);&lt;BR /&gt;print_r($result);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried with content-type : application:pdf as well&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to view file in browser or iframe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:11:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-get-preview-api-v2/m-p/288730#M17682</guid>
      <dc:creator>ashoka</dc:creator>
      <dc:date>2019-05-29T09:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in get preview api v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-get-preview-api-v2/m-p/288793#M17684</link>
      <description>&lt;P&gt;This error message is indicating that you're supply a request body with this API call, but the API expects the request body to be empty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's expected per the documentation for&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview" target="_blank"&gt;/2/files/get_preview&lt;/A&gt;, which indicates that it's a &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#formats" target="_blank"&gt;"Content-download" style endpoint&lt;/A&gt;. The documentation there covers this in more detail, but in short, you should be sending the API call parameters in a 'Dropbox-API-Arg' header, not the request body.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fix this, update your code to send the parameters in&amp;nbsp;a 'Dropbox-API-Arg' header, instead of in the request body, as you're currently doing with 'CURLOPT_POSTFIELDS'.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 15:07:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-get-preview-api-v2/m-p/288793#M17684</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-03T15:07:22Z</dc:date>
    </item>
  </channel>
</rss>

