<?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: tDropboxConnection is failing because Dropbox discontinued support for API v1 in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365153#M128793</link>
    <description>&lt;P&gt;I've been facing the same issue this week. At the end I got my job working, but I had to stop using the tdropbox family components (I didn't found any two-minutes solution).&lt;/P&gt; 
&lt;P&gt;So, my job had this structure:&lt;/P&gt; 
&lt;P&gt;tdropboxconnection -&amp;gt; tdropboxlist -&amp;gt; tdropboxget -&amp;gt; do stuff&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;That's what I did:&lt;/P&gt; 
&lt;P&gt;- I went to my dropbox app console and generated and auth_token. I hoped that would be enough to make the dropbox connection work again. It didn't. So:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- I removed the tdropbox connection&lt;/P&gt; 
&lt;P&gt;- The tdropboxlist turned into:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;· trest component. Url:&amp;nbsp;"&lt;A href="https://api.dropboxapi.com/2/files/list_folder" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.dropboxapi.com/2/files/list_folder&lt;/A&gt;", Method: post. Headers: Authorization&amp;nbsp;"Bearer base64(appkey:appsecret)", Content-Type: "application/json" (I got this info from the dropbox migration guide site)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;· The response has a schema with a 'Body' string field. I had to parse this 'Body' string to get and iterate all the "path_display" properties from the entries array (these were the files I actually wanted)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- The tdropboxget turned into the following routine (I took the code from &lt;A href="http://www.codejava.net/java-se/networking/use-httpurlconnection-to-download-file-from-an-http-url" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.codejava.net/java-se/networking/use-httpurlconnection-to-download-file-from-an-http-url&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;public static void downloadFromUrl(String dropboxFilePath, String destinationFilepath) throws IOException{
    URL url = new URL("https://content.dropboxapi.com/2/files/download");
        HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
        httpConn.setRequestProperty ("Authorization", "Bearer xxxxxx");
        httpConn.setRequestMethod("POST");
        httpConn.setRequestProperty("Dropbox-API-Arg", "{\"path\": \""+ dropboxFilePath +"\"}");
        int responseCode = httpConn.getResponseCode();
 
        // always check HTTP response code first
        if (responseCode == HttpURLConnection.HTTP_OK) {

            // opens input stream from the HTTP connection
            InputStream inputStream = httpConn.getInputStream();
             
            // opens an output stream to save into file
            FileOutputStream outputStream = new FileOutputStream(destinationFilepath);
 
            int bytesRead = -1;
            byte[] buffer = new byte[4096];
            while ((bytesRead = inputStream.read(buffer)) != -1) {
                outputStream.write(buffer, 0, bytesRead);
            }
 
            outputStream.close();
            inputStream.close();
 
            System.out.println("File downloaded");
        } else {
            System.out.println("No file to download. Server replied HTTP code: " + responseCode);
        }
        httpConn.disconnect();
  
    }&lt;/PRE&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;Hope that helps someone.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2017 15:52:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-04T15:52:30Z</dc:date>
    <item>
      <title>tDropboxConnection is failing because Dropbox discontinued support for API v1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365152#M128792</link>
      <description>&lt;P&gt;We are getting this error:&amp;nbsp;&lt;FONT color="#FF0000"&gt;com.dropbox.core.DbxClient$IODbxException: com.dropbox.core.DbxException$BadRequest: {"error": "v1_retired"}&lt;/FONT&gt; now that they retired the old API.&amp;nbsp; The terminated support for the old API last Thursday (&lt;A title="API v1 discontinued" href="https://blogs.dropbox.com/developers/2017/09/api-v1-shutdown-details/" target="_blank" rel="nofollow noopener noreferrer"&gt;link&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anybody else run into this issue?&amp;nbsp; How are you resolving it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We aren't sure if the existing tDropboxConnection component will work with a new token or if this fix is going to be more involved.&amp;nbsp; Curious if anybody else already worked through this and can point us in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Marc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 00:09:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365152#M128792</guid>
      <dc:creator>alex8675</dc:creator>
      <dc:date>2017-10-03T00:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: tDropboxConnection is failing because Dropbox discontinued support for API v1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365153#M128793</link>
      <description>&lt;P&gt;I've been facing the same issue this week. At the end I got my job working, but I had to stop using the tdropbox family components (I didn't found any two-minutes solution).&lt;/P&gt; 
&lt;P&gt;So, my job had this structure:&lt;/P&gt; 
&lt;P&gt;tdropboxconnection -&amp;gt; tdropboxlist -&amp;gt; tdropboxget -&amp;gt; do stuff&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;That's what I did:&lt;/P&gt; 
&lt;P&gt;- I went to my dropbox app console and generated and auth_token. I hoped that would be enough to make the dropbox connection work again. It didn't. So:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- I removed the tdropbox connection&lt;/P&gt; 
&lt;P&gt;- The tdropboxlist turned into:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;· trest component. Url:&amp;nbsp;"&lt;A href="https://api.dropboxapi.com/2/files/list_folder" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.dropboxapi.com/2/files/list_folder&lt;/A&gt;", Method: post. Headers: Authorization&amp;nbsp;"Bearer base64(appkey:appsecret)", Content-Type: "application/json" (I got this info from the dropbox migration guide site)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;· The response has a schema with a 'Body' string field. I had to parse this 'Body' string to get and iterate all the "path_display" properties from the entries array (these were the files I actually wanted)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;- The tdropboxget turned into the following routine (I took the code from &lt;A href="http://www.codejava.net/java-se/networking/use-httpurlconnection-to-download-file-from-an-http-url" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.codejava.net/java-se/networking/use-httpurlconnection-to-download-file-from-an-http-url&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;public static void downloadFromUrl(String dropboxFilePath, String destinationFilepath) throws IOException{
    URL url = new URL("https://content.dropboxapi.com/2/files/download");
        HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
        httpConn.setRequestProperty ("Authorization", "Bearer xxxxxx");
        httpConn.setRequestMethod("POST");
        httpConn.setRequestProperty("Dropbox-API-Arg", "{\"path\": \""+ dropboxFilePath +"\"}");
        int responseCode = httpConn.getResponseCode();
 
        // always check HTTP response code first
        if (responseCode == HttpURLConnection.HTTP_OK) {

            // opens input stream from the HTTP connection
            InputStream inputStream = httpConn.getInputStream();
             
            // opens an output stream to save into file
            FileOutputStream outputStream = new FileOutputStream(destinationFilepath);
 
            int bytesRead = -1;
            byte[] buffer = new byte[4096];
            while ((bytesRead = inputStream.read(buffer)) != -1) {
                outputStream.write(buffer, 0, bytesRead);
            }
 
            outputStream.close();
            inputStream.close();
 
            System.out.println("File downloaded");
        } else {
            System.out.println("No file to download. Server replied HTTP code: " + responseCode);
        }
        httpConn.disconnect();
  
    }&lt;/PRE&gt; 
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P class="p1"&gt;Hope that helps someone.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:52:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365153#M128793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-04T15:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: tDropboxConnection is failing because Dropbox discontinued support for API v1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365154#M128794</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;Could you please post some screenshots of your job setting on forum which will be helpful for us to address your issue?&lt;/P&gt; 
&lt;P&gt;Thanks for your time.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 09:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365154#M128794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-20T09:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: tDropboxConnection is failing because Dropbox discontinued support for API v1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365155#M128795</link>
      <description>&lt;P&gt;Thank you for the response...Actually determined that the jobs needed to be built in Talend 6.2 or above.&amp;nbsp; Once we moved to the newer version the component was compliant with the v2 API.&lt;/P&gt;
&lt;P&gt;We can consider this issue closed.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 20:58:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDropboxConnection-is-failing-because-Dropbox-discontinued/m-p/2365155#M128795</guid>
      <dc:creator>alex8675</dc:creator>
      <dc:date>2017-10-20T20:58:24Z</dc:date>
    </item>
  </channel>
</rss>

