views:

123

answers:

2

Hi,

Is it possible to create a photo collection using the flickr API? I haven't found any example code to achieve this, however you CAN do it on the flickr website, and i suppose flickr uses the API internally for their site?

Dennis

A: 

Yes, you can. But, first you need to specify so-called 'primary photo'.

This means that flickr doesn't allow you to create empty albums (collections). I don't know why they decided to restrict creation of empty collections but it's a fact.

Roman
I'm talking about collections, not sets.a collection can contain sets, and a set can contain photos.A set must indeed have a primary photo. A collection automatically creates a thumbnail for you.What is the API call in your opinion to create a collection?
Dennis De Vetter
In FlickrJ I couldn't find appropriate method.
Roman
A: 

Hi Dennis,

This may be too late to help but, I thought I'd post the solution here for posterity (as this post came up while i was google'ing for the answer before i discovered it).

The method is undocumented in the Flickr API but, it does seem to work (tested via the REST interface).

The method is: flickr.collections.create

Required parameters:

  • auth_token
  • api_sig
  • title (Example value: "My Awesome Title Here.")

Optional parameters:

  • api_key
  • auth_hash
  • cb
  • description (Example value: "My Awesome Description Here")
  • parent_id (Example Value: 0)
  • src (Example: "js")

I found the method by enabling Firebug's console while creating a collection in the Flickr web interface and examining the POST. I have no idea what auth_hash nor cb refer to but, I would assume that they are required while using the JavaScript interface as opposed to REST.

Anything that uses the JavaScript interface on Flickr can be reverse engineered by examining the POST that occurs immediately after you take the action in the web interface.

Quinn Madson