0

Since June 2014, all API keys just work via HTTPS only.Flickr deprecate non-SSL access to the API. There is another Post, but It's for 6 years ago which is before this event. I know how to download data from Flickr, and I know it should work, but the problem is the library doesn't support Https.

I am trying to count the number of Images that have been shared by a user. I used getPeopleInterface().getPublicPhotos(userId,100,1) method.

but the problem is, it returns back Error 403 for URL! I checked the Url in browser, and the Error is "SSL is required." So I changed http to https in the URL and it worked. I do not know how I can change it in my code.

public class GetUsersPhotos {
       public static void main(String[] args) throws Exception{

            String key = "";
            String secret = "";
            String userId = "78069284@N00";


            Transport t = new REST();
            Flickr f = new Flickr(key, secret, t);

            PhotoList list = f.getPeopleInterface().getPublicPhotos(userId,100,1);
            System.out.println(list);
        }


}
GeoBeez
  • 920
  • 2
  • 12
  • 20
  • Did you follow [this code example](http://www.programcreek.com/java-api-examples/index.php?api=com.flickr4java.flickr.REST#1550406) ? – Nir Alfasi Sep 25 '15 at 15:17
  • possible duplicate of [Flickr API + JAVA - flickrj](http://stackoverflow.com/questions/991623/flickr-api-java-flickrj) – Nir Alfasi Sep 25 '15 at 15:17
  • I checked it, but it doesn't help me! the problem is URL protocol which is HTTPS not http! but I do not know how to change it! – GeoBeez Sep 25 '15 at 16:01

1 Answers1

0

I solved my problem. The Flickrapi 1.2,doesn't support Https Protocol. What I did I downloaded Flickr4Java.jar which I checked and support Https, and then add the latest log4j jar file. then, it works.

GeoBeez
  • 920
  • 2
  • 12
  • 20