<?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: java.net.UnknownHostException in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234902#M12861</link>
    <description>&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt; is the correct URL. You can find the current documentation here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token&lt;/A&gt;</description>
    <pubDate>Tue, 01 Aug 2017 13:25:31 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-08-01T13:25:31Z</dc:date>
    <item>
      <title>java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234495#M12804</link>
      <description>&lt;P&gt;Unable to resolve host "api.dropboxapi.com": No address associated wi&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:20:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234495#M12804</guid>
      <dc:creator>TejaVarma</dc:creator>
      <dc:date>2019-05-29T09:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234528#M12812</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/429847"&gt;@TejaVarma&lt;/a&gt;&amp;nbsp;It looks like you didn't post the entirety of the issue. Can you share the code and full output that's giving you trouble?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on what you did post though, it looks like you're getting a UnknownHostException for api.dropboxapi.com.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Per &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/net/UnknownHostException.html" target="_self"&gt;the documentation for java.net.UnknownHostException&lt;/A&gt; this error indicates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"... that the IP address of a host could not be determined."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, it sounds like you may be&amp;nbsp;having DNS issues, preventing you from resolving the Dropbox API servers. The Dropbox API servers are resolving correctly though, so this sounds like an issue with your network connection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there any reason your app might not be able to resolve the Dropbox API servers? For example, I recommend checking any firewall, proxy, or security software that may be interfering with your network connection. Likewise, you may need to check that your DNS server is working properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 19:06:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234528#M12812</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-07-28T19:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234820#M12840</link>
      <description>&lt;P&gt;Here is code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String urlToken = &lt;SPAN&gt;"https://api.dropboxapi.com/oauth2/token"&lt;/SPAN&gt;;&lt;BR /&gt;String charset = &lt;SPAN&gt;"UTF-8"&lt;/SPAN&gt;;  &lt;SPAN&gt;// Or in Java 7 and later, use the constant: java.nio.charset.StandardCharsets.UTF_8.name()&lt;BR /&gt;&lt;/SPAN&gt;String query = String.&lt;SPAN&gt;format&lt;/SPAN&gt;(&lt;SPAN&gt;"grant_type=authorization_code&amp;amp;%s&amp;amp;code=%s&amp;amp;client_id=%s&amp;amp;client_secret=%s"&lt;/SPAN&gt;,&lt;BR /&gt;        &lt;SPAN&gt;"redirect_uri=https://192.168.137.129:8080/0/rest/cloudAdded?provider=dropbox"&lt;/SPAN&gt;,&lt;BR /&gt;        URLEncoder.&lt;SPAN&gt;encode&lt;/SPAN&gt;(authCode, charset),&lt;BR /&gt;        URLEncoder.&lt;SPAN&gt;encode&lt;/SPAN&gt;(&lt;SPAN&gt;APP_KEY&lt;/SPAN&gt;, charset),&lt;BR /&gt;        URLEncoder.&lt;SPAN&gt;encode&lt;/SPAN&gt;(&lt;SPAN&gt;APP_SECRET&lt;/SPAN&gt;, charset));&lt;BR /&gt;Log.&lt;SPAN&gt;d&lt;/SPAN&gt;(&lt;SPAN&gt;LOG_TAG&lt;/SPAN&gt;, &lt;SPAN&gt;"getInputStreamAsString()"&lt;/SPAN&gt;);&lt;BR /&gt;String inputStreamAsString = AccountsManager.&lt;SPAN&gt;getInputStreamAsString&lt;/SPAN&gt;(urlToken, charset, query);&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;PRE&gt;String result = &lt;SPAN&gt;""&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;{&lt;BR /&gt;    URL url = &lt;SPAN&gt;new &lt;/SPAN&gt;URL(urlStr);&lt;BR /&gt;    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;// Create the SSL connection&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/*SSLContext sc;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;sc = SSLContext.getInstance("TLS");&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;sc.init(null, null, new java.security.SecureRandom());&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;conn.setSSLSocketFactory(sc.getSocketFactory());*/&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    // set Timeout and method&lt;BR /&gt;&lt;/SPAN&gt;    conn.setReadTimeout(&lt;SPAN&gt;15000&lt;/SPAN&gt;);&lt;BR /&gt;    conn.setConnectTimeout(&lt;SPAN&gt;15000&lt;/SPAN&gt;);&lt;BR /&gt;    conn.setUseCaches(&lt;SPAN&gt;false&lt;/SPAN&gt;);&lt;BR /&gt;    conn.setDoInput(&lt;SPAN&gt;true&lt;/SPAN&gt;);&lt;BR /&gt;    conn.setDoOutput(&lt;SPAN&gt;true&lt;/SPAN&gt;); &lt;SPAN&gt;// Triggers POST.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    conn.setRequestProperty(&lt;SPAN&gt;"Content-Language"&lt;/SPAN&gt;, &lt;SPAN&gt;"en-US"&lt;/SPAN&gt;);&lt;BR /&gt;    conn.setRequestProperty(&lt;SPAN&gt;"Accept-Charset"&lt;/SPAN&gt;, charset);&lt;BR /&gt;    conn.setRequestProperty(&lt;SPAN&gt;"Content-Type"&lt;/SPAN&gt;, &lt;SPAN&gt;"application/x-www-form-urlencoded"&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;// conn.setRequestProperty("Content-Length", "" + Integer.toString(_charset.getBytes().length));&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    OutputStream os       = conn.getOutputStream();&lt;BR /&gt;    os.write(query.getBytes(charset));&lt;BR /&gt;    os.close();&lt;BR /&gt;&lt;BR /&gt;    conn.connect();&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;String err = new String();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;InputStream errStream = conn.getErrorStream();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;BufferedReader errReader = new BufferedReader(new InputStreamReader(errStream));&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;String eLine;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;while ((eLine = errReader.readLine()) != null) {&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    err += eLine;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Log.e(LOG_TAG, "ERROR : " + err);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;*/&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    Log.&lt;SPAN&gt;d&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;"getInputStreamAsString() : responseCode: " &lt;/SPAN&gt;+ conn.getResponseCode() +&lt;BR /&gt;            &lt;SPAN&gt;"response message : " &lt;/SPAN&gt;+ conn.getResponseMessage());&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;//read the inputStream into a string&lt;BR /&gt;&lt;/SPAN&gt;    result = &lt;SPAN&gt;new &lt;/SPAN&gt;String();&lt;BR /&gt;    InputStream is = conn.getInputStream();&lt;BR /&gt;    BufferedReader in = &lt;SPAN&gt;new &lt;/SPAN&gt;BufferedReader(&lt;SPAN&gt;new &lt;/SPAN&gt;InputStreamReader(is));&lt;BR /&gt;    String inputLine;&lt;BR /&gt;    &lt;SPAN&gt;while &lt;/SPAN&gt;((inputLine = in.readLine()) != &lt;SPAN&gt;null&lt;/SPAN&gt;) {&lt;BR /&gt;        result += inputLine;&lt;BR /&gt;    }&lt;BR /&gt;} &lt;SPAN&gt;catch &lt;/SPAN&gt;(Exception e) {&lt;BR /&gt;    Log.&lt;SPAN&gt;w&lt;/SPAN&gt;(&lt;SPAN&gt;""&lt;/SPAN&gt;, &lt;SPAN&gt;"Exception thrown " &lt;/SPAN&gt;+ e.getMessage());&lt;BR /&gt;    &lt;SPAN&gt;throw new &lt;/SPAN&gt;UnsupportedOperationException(&lt;SPAN&gt;"TODO : handle this"&lt;/SPAN&gt;);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Most of the time code is working fine. But Some time I am getting error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:28:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234820#M12840</guid>
      <dc:creator>TejaVarma</dc:creator>
      <dc:date>2017-07-31T19:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234824#M12842</link>
      <description>&lt;P&gt;Thanks! By the way, it looks like you're not using &lt;A href="https://github.com/dropbox/dropbox-sdk-java" target="_self"&gt;the official&amp;nbsp;Dropbox API v2 Java SDK&lt;/A&gt;. We do highly reccomend using it, if possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, whether or not you're using it, it does just look like this error is due to intermittent DNS issues, so you should look into why your DNS queries may be failing occasionally.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:44:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234824#M12842</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-07-31T19:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234898#M12859</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using Dropbox API v2 libary, instead of using&amp;nbsp;&lt;STRONG&gt;Auth,&amp;nbsp;&lt;/STRONG&gt;I am using API directly. &amp;nbsp;I cahnged url from v1 to v2. From this url&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/reference/migration-guide&amp;nbsp;" target="_blank"&gt;https://www.dropbox.com/developers/reference/migration-guide&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed url&amp;nbsp;&lt;A href="https://www.dropbox.com/developers-v1/core/docs#oa2-token" target="_blank"&gt;&lt;SPAN class="migration__code-inline"&gt;/1/oauth2/token&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class="migration__code-inline"&gt;&amp;nbsp;to&amp;nbsp;&lt;A href="https://www.dropbox.com/developers-v1/core/docs#oa2-token" target="_blank"&gt;/oauth2/token&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="migration__code-inline"&gt;Right now it is working fine. By changing WIFI settings. If I face same problem I will let you know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="migration__code-inline"&gt;Please confirm weather I am using correct URL of V2 or not?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:20:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234898#M12859</guid>
      <dc:creator>TejaVarma</dc:creator>
      <dc:date>2017-08-01T13:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: java.net.UnknownHostException</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234902#M12861</link>
      <description>&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt; is the correct URL. You can find the current documentation here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token&lt;/A&gt;</description>
      <pubDate>Tue, 01 Aug 2017 13:25:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/java-net-UnknownHostException/m-p/234902#M12861</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-08-01T13:25:31Z</dc:date>
    </item>
  </channel>
</rss>

