Galleries

## Galleries Galleries — Galleries of photos. |

## Synopsis

                        flickcurl_gallery;
    void                flickcurl_free_gallery              (flickcurl_gallery *gallery);
    void                flickcurl_free_galleries            (flickcurl_gallery **galleries_object);
    int                 flickcurl_galleries_addPhoto        (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *photo_id,
                                                             const char *comment_text);
    char *              flickcurl_galleries_create          (flickcurl *fc,
                                                             const char *title,
                                                             const char *description,
                                                             const char *primary_photo_id,
                                                             char **gallery_url_p);
    int                 flickcurl_galleries_editMeta        (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *title,
                                                             const char *description);
    int                 flickcurl_galleries_editPhoto       (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *photo_id,
                                                             const char *new_comment);
    int                 flickcurl_galleries_editPhotos      (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *primary_photo_id,
                                                             const char **photo_ids_array);
    flickcurl_gallery * flickcurl_galleries_getInfo         (flickcurl *fc,
                                                             const char *gallery_id);
    flickcurl_gallery ** flickcurl_galleries_getList        (flickcurl *fc,
                                                             const char *user_id,
                                                             int per_page,
                                                             int page);
    flickcurl_gallery ** flickcurl_galleries_getListForPhoto
                                                            (flickcurl *fc,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);
    flickcurl_photos_list * flickcurl_galleries_getPhotos_params
                                                            (flickcurl *fc,
                                                             const char *gallery_id,
                                                             flickcurl_photos_list_params *list_params);
    flickcurl_photo **  flickcurl_galleries_getPhotos       (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *extras,
                                                             int per_page,
                                                             int page);

## Description

Galleries of photos.

## Details

### flickcurl_gallery

    typedef struct {
      char *id;
      char *url;
      char *owner;
      int date_create;
      int date_update;
      flickcurl_photo* primary_photo;
      int count_photos;
      int count_videos;
      char *title;
      char *description;
    } flickcurl_gallery;

A photo gallery.

The list of photos in the gallery is available via the API calls `flickcurl_galleries_getPhotos()` or `flickcurl_galleries_getPhotos_params()`

char *`id`; | gallery ID
char *`url`; | URL of gallery
char *`owner`; | owner NSID
int `date_create`; | creation date of gallery
int `date_update`; | update / last modified date of gallery
flickcurl_photo *`primary_photo`; | primary photo for the gallery
int `count_photos`; | number of photos in the gallery
int `count_videos`; | number of photos in the gallery
char *`title`; | Gallery title
char *`description`; | Gallery description

### flickcurl_free_gallery ()

    void                flickcurl_free_gallery              (flickcurl_gallery *gallery);

Destructor for gallery object

`gallery` : | gallery object

### flickcurl_free_galleries ()

    void                flickcurl_free_galleries            (flickcurl_gallery **galleries_object);

Destructor for array of gallery objects

`galleries_object` : | gallery object array

### flickcurl_galleries_addPhoto ()

    int                 flickcurl_galleries_addPhoto        (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *photo_id,
                                                             const char *comment_text);

Add a photo to a gallery.

Implements flickr.galleries.addPhoto (1.17)

`fc` : | flickcurl context
`gallery_id` : | The ID of the gallery to add a photo to as returned by `flickcurl_galleries_getList()` and `flickcurl_galleries_getListForPhoto()`.
`photo_id` : | The photo ID to add to the gallery.
`comment_text` : | A short comment or story to accompany the photo (or NULL).
Returns : | non-0 on failure

### flickcurl_galleries_create ()

    char *              flickcurl_galleries_create          (flickcurl *fc,
                                                             const char *title,
                                                             const char *description,
                                                             const char *primary_photo_id,
                                                             char **gallery_url_p);

Create a new gallery for the calling user.

Implements flickr.galleries.create (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`title` : | The name of the gallery
`description` : | A short description for the gallery
`primary_photo_id` : | The first photo to add to your gallery (or NULL)
`gallery_url_p` : | pointer to variable to store new gallery URL (or NULL)
Returns : | gallery ID or NULL on failure

### flickcurl_galleries_editMeta ()

    int                 flickcurl_galleries_editMeta        (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *title,
                                                             const char *description);

Modify the meta-data for a gallery.

Implements flickr.galleries.editMeta (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`gallery_id` : | The gallery ID to update.
`title` : | The new title for the gallery.
`description` : | The new description for the gallery. (or NULL)
Returns : | non-0 on failure

### flickcurl_galleries_editPhoto ()

    int                 flickcurl_galleries_editPhoto       (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *photo_id,
                                                             const char *new_comment);

Edit the comment for a gallery photo.

Implements flickr.galleries.editPhoto (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`gallery_id` : | The ID of the gallery to add a photo to. Note: this is the compound ID returned in methods like flickr.galleries.getList, and flickr.galleries.getListForPhoto.
`photo_id` : | The photo ID to add to the gallery.
`new_comment` : | The updated comment the photo.
Returns : | non-0 on failure

### flickcurl_galleries_editPhotos ()

    int                 flickcurl_galleries_editPhotos      (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *primary_photo_id,
                                                             const char **photo_ids_array);

Modify the photos in a gallery. Use this method to add, remove and re-order photos.

Implements flickr.galleries.editPhotos (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`gallery_id` : | The id of the gallery to modify. The gallery must belong to the calling user.
`primary_photo_id` : | The id of the photo to use as the 'primary' photo for the gallery. This id must also be passed along in photo_ids list argument.
`photo_ids_array` : | Array of photo ids to include in the gallery. They will appear in the set in the order sent. This list MUST contain the primary photo id. This list of photos replaces the existing list.
Returns : | non-0 on failure

### flickcurl_galleries_getInfo ()

    flickcurl_gallery * flickcurl_galleries_getInfo         (flickcurl *fc,
                                                             const char *gallery_id);

Get information for a gallery.

Implements flickr.galleries.getInfo (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`gallery_id` : | The gallery ID you are requesting information for.
Returns : | gallery or NULL on failure

### flickcurl_galleries_getList ()

    flickcurl_gallery ** flickcurl_galleries_getList        (flickcurl *fc,
                                                             const char *user_id,
                                                             int per_page,
                                                             int page);

Return the list of galleries created by a user.

Galleries are returned sorted from newest to oldest.

Implements flickr.galleries.getList (1.17)

`fc` : | flickcurl context
`user_id` : | The NSID of the user to get a galleries list for. If none is specified, the calling user is assumed.
`per_page` : | Number of galleries to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | array of galleries or NULL on failure

### flickcurl_galleries_getListForPhoto ()

    flickcurl_gallery ** flickcurl_galleries_getListForPhoto
                                                            (flickcurl *fc,
                                                             const char *photo_id,
                                                             int per_page,
                                                             int page);

Return the list of galleries to which a photo has been added.

Galleries are returned sorted by date which the photo was added to the gallery.

Implements flickr.galleries.getListForPhoto (1.17)

`fc` : | flickcurl context
`photo_id` : | The ID of the photo to fetch a list of galleries for.
`per_page` : | Number of galleries to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500. (or < 0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
Returns : | array of galleries or NULL on failure

### flickcurl_galleries_getPhotos_params ()

    flickcurl_photos_list * flickcurl_galleries_getPhotos_params
                                                            (flickcurl *fc,
                                                             const char *gallery_id,
                                                             flickcurl_photos_list_params *list_params);

Return the list of photos for a gallery

Currently supported extras fields are: description, license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_m, url_o

`fc` : | flickcurl context
`gallery_id` : | The ID of the gallery of photos to return
`list_params` : | flickcurl_photos_list_params result parameters (or NULL)
Returns : | list of people public photos or NULL on failure

### flickcurl_galleries_getPhotos ()

    flickcurl_photo **  flickcurl_galleries_getPhotos       (flickcurl *fc,
                                                             const char *gallery_id,
                                                             const char *extras,
                                                             int per_page,
                                                             int page);

Return the list of photos for a gallery

See `flickcurl_galleries_getPhotos_params()` for details of `extras`.

Implements flickr.galleries.getPhotos (1.18)

Announced 2010-04-08 http://code.flickr.com/blog/2010/04/08/galleries-apis/

`fc` : | flickcurl context
`gallery_id` : | The ID of the gallery of photos to return
`extras` : | A comma-delimited list of extra information to fetch for each returned record.
`per_page` : | Number of photos to return per page (default 100, max 500)
`page` : | The page of results to return (default 1)
Returns : | list of photos or NULL on failure