How to access private photos through Flickrj Api? -


I am making an authentic call to access photos through the Flickr API. But I'm not just getting my personal photos but also any personal photos

I'm using the code below,

  is Flickr .; RequestContext requests signal; String frab = ""; String token = ""; Documentbuilder xmlParser = null; Public void getImages () ParserConfigurationException, IOException, SAXException, FlickrException, URISyntaxException, NoSuchAlgorithmException {DocumentBuilderFactory DCB = DocumentBuilderFactory.newInstance () throws; Try {This.xmlParser = dcb.newDocumentBuilder (); } Hold (parser configuration expansion pre) {ex.printStackTrace (); } F = new Flickr ( "199d038ad88f6c6c377a4ab2341fb60f", "4583b2386d3d6439", new rest ()); Flickr Debestream = false; RequestContext = RequestContext.getRequestContext (); AuthInterface authInterface = f.getAuthInterface (); // peopleInterface people interface = F.JetPeppleInterface (); Try {frob = authInterface.getFrob (); } Hold (Flickr option e) {e.printStackTrace (); } System.out.println ("frob:" + frob); Java.net.URL url = authInterface.buildAuthenticationUrl (permission. READ, frob); Println (url.toExternalForm ()); Desktop desktop = desktopgate desktop (); Desktop.browse (url.toURI ()); // Receive auth auth = null; String align = ""; While (aleine.equals ("")) {java.io.DataInputStream in = new java.io.DataInputStream (System.in); ALine = in.readLine (); } Auth = authInterface.getToken (frob); System.out.println ("auth =" + auth); RequestContext = RequestContext.getRequestContext (); RequestContext.setAuth (certification); F.setAuth (certification); URLInterface URLInterface = F.Jet URLS Interface (); PhotoInterface PhotoInterface = F.F.F. PhotoInterface (); Search parameter search mercury = new search parameter (); SearchParams.setSort (SearchParameters.INTERESTINGNESS_DESC); // Perform search with entered tag search. PARAM.setUserId (auth.getUser (.) GetId ()); Photolist Photolist = Photo Interface Search (Search Perm, 10, 1); If (photoList! = Null) for {// Get the search results and (int i = 0; i & lt; photoList.size (); i ++) {Photo = (Photo) photoList.get (i) Check the size of the photo result; Println (photo.getSmallSquareUrl ()); }}  

It is possible to access the confidential data by editing flickrj.

I added auth_token com.aetrion.flickr.photos.PhotosInterface parameter:

  public PhotoList search ( SearchParameters parameters Peprej Int, Int page) throws IOException, SAXException, Flickr Akspesheshn {PhotoList photos = new PhotoList (); List parameter = new ArrayList (); Parameters.add (new parameter ("method", METHOD_SEARCH)); Parameters.add (new parameter ("API_key", APKY)); Parameters.addAll (params.getAsParameters ()); If (per page & gt; 0) {parameters.add (new parameter ("per_page", "" + perPage)); } If (page & gt; 0) {parameters.add (new parameter ("page", "" + page)); } // string token = RequestContext.getRequestContext (). GetAuth () GetToken (); If (token = null!) Parameters.add (new parameter ("auth_token", RequestContext.getRequestContext () getAuth () getToken ()) ..); // parameters.add (new parameter ("API_sig", AuthUtilities.getSignature (shared signals, parameters)); Feedback response = transport.get (transport.getPath (), parameter);  

With this change, I could get my personal photos.

Flickr API Docs says, " Both are required for each authenticated call auth_token and api_sig logic ".. and which was missing.

I took this idea out there: and used a servlet to reach Flickr.


Comments