Android - Error 403 when using Clearbit logo API

Viewed 132

I have been trying to implement the retrieval of a company logo using Clearbits.Logo.

url = new URL(Constants.URL_PREFIX_LOGO + shop.getDomainName());
            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
            httpURLConnection.setDoOutput(true);
            httpURLConnection.connect();
            int responseCode = httpURLConnection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_FORBIDDEN) {
                //Download picture from URL
                ..
            }

However, for a reason I simply cannot understand, connect() always returns a 403 error with no further explanations.

The device is connected to the internet and has a permission to access it, the URL is exact, and the most bizarre of all, the URL can be accessed through the device browser without any error. The URL doesn't require any authentification https://logo.clearbit.com/carrefour.eu?size=600

I can't find the reason why this 403 keeps occuring .. has anyone an idea ?

0 Answers
Related