Search code examples
javascriptnode.jsnpmflickr

Issue in Flicker Api when accessing own photos


I am trying to access my own pictures via this function https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm on a node package that I got from here https://www.npmjs.com/package/flickrapi\

If I try to access pictures of any other user (say, 136485307@N06 - Apollo Image Gallery) I have no problem getting the pictures. But, if I try to access my own pictures, via user_id: "132868185@N07 or user_id: "me" I get nothing back from the service. My code right now looks like this:

var Flickr = require("flickrapi");
var FlickCred = require("./flickrAuthCred");

var flickrOptions = FlickCred;

Flickr.authenticate(flickrOptions, function(error, flick){
    if(error){
        console.log("Error!");
        console.log(error);
        return;
    }

    var photosReqOptions = {
        user_id: "132868185@N07",
        extras: ["owner_name", "date_taken", "date_upload", "path_alias"]
    }

    flick.people.getPhotosOf(photosReqOptions, function(error, data){
        console.log(data.photos);
    });
});

I feel I am missing a step, but I cannot determine which. Any suggestion will help!


Solution

  • Ok I found the problem. I was trying to use the wrong function. Namely, I was trying to use flick.people.getPhotosOf https://www.flickr.com/services/api/flickr.people.getPhotosOf.htm

    When I should have used flick.people.getPhotos https://www.flickr.com/services/api/flickr.people.getPhotos.html