This project has moved and is read-only. For the latest updates, please go here.

flickr.groups.pools.getPhotos Question

Topics: User Forum
Sep 27, 2006 at 2:51 PM

I'm trying to use this function in the FlickrNet library and am having issues. It seems to be returning no photos when I run it. My test groupid is 78421854@N00.

When I try it in the API Explorer on Flickr's site, it only returns photos if I click the 'Sign call as username with full permissions?' radio button. Otherwise it returns nothing.

FlickrNet nor Flickr's documentation seem to indicate that I need to do any kind of authorization to use this method.

If anyone can provide ideas or a sample, that would be great!

I'm using ASP.NET 2.0, and basically what I need to do is return all the photos in a certain group.

Thank you!
Sep 27, 2006 at 4:07 PM

For that particular search you don't NEED to provide authentication details (i.e. it doesn't throw an exception if you don't).

However, as you are seeing, if there are no photos that are viewable to an unauthorised user you will not see any photos being returned.

Therefore, in this instance you will need to provide the authentication token to the FlickrNet library.

If you need more help on how to do this then try downloading the sample application and looking at the code, or use it to get an authentication token and store that in your application.
Sep 27, 2006 at 9:36 PM
I'd like to just get the token and store it ideally, but I can't seem to figure out how to do that. I can't find the example application you are referring to.

Thanks in advance for any help!
Sep 27, 2006 at 9:50 PM
I guess this is really a question on how authorization works. So far, I haven't had much luck. What I want to do (and it looks like I can) is somehow get an auth token, and then store that in the web.config and use that to authorize the web app each time. The trick, it seems, is getting that auth token... right now, I'm trying something like this (which doesn't work):

Flickr flickr = new Flickr();
Response.Write ("apiKey = " + flickr.ApiKey + "<br>");
Response.Write ("apiSecret = " + flickr.ApiSecret + "<br>");
Response.Write ("apiToken = " + flickr.ApiToken + "<br>");

string frob = flickr.AuthGetFrob();

Auth a = flickr.AuthGetToken(frob);
Response.Write ("frob = " + frob + "<br>");
Response.Write ("token = " + a.Token + "<br>");

So what am I missing? Do I have to do something in Flickr itself, setting up the authentication for this API key? And if so, what? I'm sorry, but the docs for Flickr itself are very sparse and make a lot of assumptions. And I'm coming from the world of WSDL Web Services, so this is kind of a shocker for me. :)

Thanks again for the help in advance.
Sep 28, 2006 at 9:13 AM
You certainly can store the auth token in the web.config file, see the Config File example for where to store that if you didn't already know that.

You can download the example application on the Channel 9 web site. I'll upload it here as well at some point.

You can use it to generate the authentication token - just load one of the example forms, put in your api key and secret and click the "authenticate" button.

As for your code, thats exactly what you have to do, except you need to redirect to the Flickr web site inbetween the GetFrob and the GetToken calls, again, see the application above for an example of how to do this.
Sep 29, 2006 at 8:06 PM
Thank you! That completely solved my problem! I do have another question; I will post a separate thread since it's a separate issue.