Support Center

Fotomoto API Function reference page

Last Updated: Dec 12, 2012 05:08PM PST

Version 0.8, Last Update: 22 June 2010


The namespace for all API functions is FOTOMOTO.API

Product Constants values (used to call API functions):

FOTOMOTO.API.BUY = 10 (this can be used to automatically show the first available product window)
FOTOMOTO.API.PRINT = 100
FOTOMOTO.API.PREMIUM = 101
FOTOMOTO.API.FINEART = 102
FOTOMOTO.API.CANVAS = 103
FOTOMOTO.API.STICKY = 105 (Wall Peels)
FOTOMOTO.API.ECARD = 200
FOTOMOTO.API.FACEBOOK = 201
FOTOMOTO.API.TWITTER = 202
FOTOMOTO.API.GPLUS = 205
FOTOMOTO.API.CARD = 300
FOTOMOTO.API.FILE = 400 (Digital Download)

FOTOMOTO.API.MENU_ALL = 1;
FOTOMOTO.API.MENU_BUY = 2;
FOTOMOTO.API.MENU_SHARE = 3;

FOTOMOTO.API.POSITION.ABOVE = 0;
FOTOMOTO.API.POSITION.BELOW = 1;


FOTOMOTO.API.checkinImage(image)
if the Photo does not exist in our database, this should add the photo to our database. It will also set all the analytics info. This does not return anything and is asynchronous.
+ @param image: can be an element ID, an HTML image object, or a full image URI

FOTOMOTO.API.checkinImage(image, callback, collection key)
Overloaded function to allow the user to set the collection that the image is added to, you will need the collection key (use API.collectionList). If and only if the Photo does not exist in our database, this will add the photo to our database into the said collection. It will also set all the analytics info. The callback function either returns the image object or null if it is unsuccesful and is asynchronous. To not set a callback pass the empty string "".
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ @param callback: a string that is the name of the callback function
+ @param collection key: String obtained from the collectionList() API function


FOTOMOTO.API.checkinImage(image, callback, collection key, store_key)
Further overloaded function to allow adding an image to a specific store. Set callback to the empty string and the collection key to null. If and only if the Photo does not exist in our database, this will add the photo to specified users store, otherwise it will update the analytics.
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ @param callback: a string that is the name of the callback function
+ @param collection key: String obtained from the collectionList() API function

+ @param store_key: a string of the Sellers StoreID

FOTOMOTO.API.collectionList(callback)
The callback function will be given an array of objects each with two attributes a key for passing to checkinImage to set the collection and a name which is human readable.
+ @param callback: a string that is the name of the callback function or a anonymous function

FOTOMOTO.API.showToolbar(container, image)
Insert a toolbar in the given place for the specified photo
+ @param container: can be an element ID, or an HTML object
+ @param @param image: can be an element ID, an HTML image object, or a full image URI
+ @return toolbarID


FOTOMOTO.API.updateToolbar(toolbarID, image)
updates a toolbar for a specified photo
@param toolbarID: Toolbar ID
@param image: can be an element ID, an HTML image object, or a full image URI
@return toolbarID


FOTOMOTO.API.deleteToolbar(toolbarID)
resets a toolbar in a specified container
+ @param container: can be an element ID, or an HTML object
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ returns toolbarID

FOTOMOTO.API.showWindow(page, image, anchor)
shows the widget passed page in parameter for the specified image
+ @param page: one of the product constants, pass 10 for default page
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ @param anchor: an HTML element. This is required for page FOTOMOTO.API.SHARE onlyI


FOTOMOTO.API.showMenu(anchor, image, menutype)
shows the passed page in parameter for the specified image
+ @param anchor: an HTML element. 
+ @param image: can be an element ID, an HTML image object, or a full image URI

+ @param menutype: type of menu. FOTOMOTO.API.MENU_ALL will be used if not assigned

FOTOMOTO.API.checkout()
shows checkout window, if there’s anything is the basket

FOTOMOTO.API.getTotalItems()
Returns the number of items that are in the shopping cart.
+ @return a integer

FOTOMOTO.API.isBasketEmpty()
checks if the shopping basket is empty or not
+ @return a boolean value

FOTOMOTO.API.getStoreID(url, callback)
the store ID for a URL
+ @param url: the domain registered with Fotomoto
+ @param callback: a string that is the name of the callback function.
+ @return the store ID for a URL


FOTOMOTO.API.getProducts(storeID, callback)
returns a hash with true/false values for each main product (in constants, like PRINT, ECARD, etc) for a store
+ @param storeID: client’s unique StoreID
+ @param callback: a string that is the name of the callback function.
+ @return a hash


FOTOMOTO.API.getCaptions(storeID, callback)
returns a hash with string values for each main product (in constants, like PRINT, ECARD, etc)
+ @param storeID: client’s unique StoreID
+ @param callback: a string that is the name of the callback function.
+ @return a hash


FOTOMOTO.API.getImageProducts(image, callback)
returns a hash with true/false values for each main product (in constants, like PRINT, ECARD, etc) for an image
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ @param callback: a string that is the name of the callback function.
+ @return a hash


FOTOMOTO.API.getToolbarLinks(image, callback, extra, menutype)
returns an array of links for available products of a photo in API mode
+ @param image: can be an element ID, an HTML image object, or a full image URI
+ @param callback: name of the callback function (string)
+ @param extra: extra information that will to passed to the callback (hash)
+ @param menutype: type of menu. FOTOMOTO.API.MENU_ALL will be used if not assigned
+ @return a hash


FOTOMOTO.API.showMenuForFlash(flash_id, position, image, menu_type, menu_position)
returns an array of links for available products of a photo in API mode
+ @param flash_id:  html element of the flash object
+ @param position: a hash of the anchor position with contents: top, left, width, height
+ @param image: The image's full 
URl
+ @param menu_type: type of menu displayed. FOTOMOTO.API.MENU_ALL used if none assigned 
+ @param a menu_position: set to 0 to show menu above or  to 1 to show menu below anchor 

 

Don't find what you are looking for? Try our community discussions.

Announcements View Discussions

Have A Question?

Recent Discussions

Go to Discussion Forums ​​

Track Your Package

Track your FedEx package
Track Your UPS package


powered by Desk.com