Knowledge Base: users.favourites.index

users.favourites.index

Method Type: GET
Required Parameters: username
Optional Parameters: api_key, user_token, page

Displays the last 10 images in a users collection along with user info and the medium file info.

Required Parameters

username:       The username. [string]

Optional Parameters

api_key:        API token for your client.
user_token:     The user token for the owner of the collection.
page:           The page of images to return. [int]

Usage

// To retrieve all public favourites.
http://api.emberapp.com/users/view/{username}/favourites/index

// To retrieve the next 10 images.
http://api.emberapp.com/users/view/{username}/favourites/index?page=2

// To get the other privacy levels also pass in the user token.
https://api.emberapp.com/users/view/{username}/favourites/index?api_key={api_key}&user_token={user_token}

Response

Each favourite is returned in an array with the following parameters.

favourite item:

name:           Name of the image: [string]
token:          Unique identifier for the image. [string]
shared_token:   Token for the parent image if it exists. [string]
description:    Description of the image. [string]
rating:         Rating of the image 0-5. [int]
url:            The original url of the image (if web snap). [string]
date_taken:     Unix timestamp the image was created. [int]
slug:           The slug used by the image on the site unique to the owner. [string]
views:          The number of times the image has been viewed. [int]
created:        Unix Timestamp the image was added. [int]
user:           User information. [array]
file:           File information for the medium image. [array]
permalink:      URL to the image page on Ember [string]

user item:

username:       Users username and unique identifier. [string]
fullname:       Users fullname. [string]
bio:            Users bio. [string]
url:            Users homepage. [string]
total_images:   Total images the user has uploaded to Ember. [int]
avatar:         Array containing the medium avatar information. [array]

file item:

size:           Size flag of the image (sq, t, s, m, l, o). [string]
width:          Width in px of the image. [int]
height:         Height in px of the image. [int]
filesize:       Size in bytes of the file. [int]
src:            Url to the file for the image. [string]

Example XML Response

<?xml version="1.0"?>
<response>
    <status code="0">OK</status>
    <api>api.users.favourites.index</api>
    <favourites>
        <favourite>
            <name>Thurly App</name>
            <token>10421277694a5ea0be2f891</token>
            <shared_token>10421277694a5ea0be2f891</shared_token>
            <description/>
            <rating>5</rating>
            <url>http://thurlyapp.com/</url>
            <date_taken>1247714186</date_taken>
            <slug>thurly-app</slug>
            <views>235</views>
            <created>1247715518</created>
            <user>
                <username>elixir</username>
                <fullname>elixir</fullname>
                <bio/>
                <url>http://www.elixirgraphics.com</url>
                <created>1224801022</created>
                <total_images>120</total_images>
                <total_followers>9</total_followers>
                <total_following>0</total_following>
            </user>
            <file>
                <size>m</size>
                <width>600</width>
                <height>777</height>
                <filesize>247219</filesize>
                <src>http://emberapp.com/elixir/images/thurly-app/sizes/m.png</src>
            </file>
            <permalink>http://emberapp.com/elixir/images/thurly-app</permalink>
        </favourite>
    </favourites>
</response>