Tag-based search in (my) private group

Topics: Developer Forum
Nov 6, 2012 at 12:57 AM

Does the Flickr.NET allow my code to do a search for all images with a particular tag in my private group?

I can get it to work with the API explorer. Here's the URL string with my real data replaced with nonsensical strings:

URL: http://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=fiddledee&group_id=abcde&tags=fghijk&format=rest&auth_token=foo&api_sig=bar

And, like I said, this works.

It may be extremely obvious. But I don't know how to do this in Flickr.NET. My code is based entirely on the FlickrNetSamples Solution, WinForms project. The authentication part of the code seems to work, in that it takes me to my Flickr user page, I allow my app to work, and it gives me a string that I paste into my app. It seems to work since I can do a regular photo search. But I can't search for a tag within my private group.

First, I tried doing the following:

   PhotoCollection pc = new PhotoCollection();

   pc = f.GroupsPoolsGetPhotos("MyGroupID", "MyTag");

 

But this throws an exception with the following message: You don't have permission to view this pool (2)

Next, I tried using an instance of the PhotoSearchOptions class and it throws an exception on the last line of the following code, saying "You don't have permission to view this pool (4)":

 

Flickr f = FlickrManager.GetInstance();PhotoSearchOptions o = new PhotoSearchOptions();o.Extras = PhotoSearchExtras.AllUrls | PhotoSearchExtras.Description | PhotoSearchExtras.OwnerName;o.SortOrder = PhotoSearchSortOrder.Relevance;o.Tags = "ThisIsMyTag";o.GroupId = "ThisIsMyGroupID";
bindingSource1.DataSource = f.PhotosSearch(o);

 

What am I doing wrong?

 

Thanks!

 

~Michael

Coordinator
Nov 6, 2012 at 6:53 AM

You need to call FlickrManager.GetAuthInstance() to get an instance of the Flickr class with the correct authentication token set (assuming you have successfully authenticated prior to this).

Sam

Nov 6, 2012 at 4:02 PM

You're right. That did the trick! It now works. Thank you very much. I really appreciate your help resolving this issue.