Salesforce

Fotomoto API Function reference page

« Go Back

Information

 
Body

Version 0.8, Last Update: March 9, 2022


The namespace for all API functions is FOTOMOTO.API

Product Constants values (used to call API functions):

FOTOMOTO.API.BUY = 10
FOTOMOTO.API.PRINT = 100 (this can be used to automatically show the first available product window)
FOTOMOTO.API.PREMIUM = 101
FOTOMOTO.API.FINEART = 102
FOTOMOTO.API.CANVAS = 103
FOTOMOTO.API.FRAMED = 104
FOTOMOTO.API.STICKY = 105 (Wall Peels)
FOTOMOTO.API.METAL = 106
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.SHARE = 500

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 image: can be an element ID, an HTML image object, or a full image URI
returns 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
returns 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 screen in widget if there’s anything is the basket, otherwise displays "The cart is empty" message.

FOTOMOTO.API.getTotalItems()
Returns the number of items that are in the shopping cart.
returns an integer

FOTOMOTO.API.isBasketEmpty()
Checks if the shopping basket is empty or not
returns 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.
returns 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

TitleFotomoto API Function reference page
URL Name8317fotomoto-api-function-reference-page


Powered by