Location via proxy:   [ UP ]  
  [Manage cookies]                

API Overview

All API requests are done using a RESTful format. Simply GET or POST to the appropriate endpoint adding the proper name value pairs as documented here. Data is returned as either XML or JSON. By default data is returned as XML. To enable JSON simply append the extension ".json" to your request. The domain of your api request should always include the user you wish to authenticate for.

http://someuser.multiply.com/api/somemethod?password=somepassword&param1=someparam1&...

If you are authenticating via OAuth, the password parameter is not required, however the user must allow your application to access their data. See the Multiply OAuth documentation for details.

Support

Official support, examples and code libraries can be found at the api group site, MultiplyAPI.

Authentication

  • Basic (base64 encode uname:password in HTTP Authentication Header)
  • as RESTful arguments ($uid gleaned from domain, password=$password in query string)
  • OAuth token

Authentication failures will be returned as 401 HTTP_UNAUTHORIZED errors.



Developer Key

All API requests must supply a developer key, which is tied to a particular Multiply user. (Usually the developer of the application.) To retrieve your developer key, visit http://multiply.com/apis/developer-key while logged in as the user whose developer key you would like to retrieve.

Each request should send the application's key as api_key=$developer_key in the query string

Returning data

Data will be formatted as xml or json according to the extension of the query. Additionally json formatted requests can include a “callback=$callback” in the query string to have the data returned as a javascript function with the json string as its argument.

Invalid format requests will be returned with an HTTP_NOT_ACCEPTABLE error.



Errors

Any errors will be reported back to the client with the appropriate non-200 (HTTP_OK) status code as well as a short error message in the body of the document. Provided a valid format is requested, the error message will be encapsulated using xml or json. Due to a limitation with the apache web server the Content-type header associated with error messsages will always be 'text/html'. The actual data returned will have the requested format, however, so api clients should simply ignore this header.

curl -i 'http://foonasty.multiply.com/api/mailbox.xml?password=badpass'

HTTP/1.x 403 Forbidden
Date: Tue, 04 Aug 2009 20:28:31 GMT
Server: Apache/1.3.29 (Unix) mod_perl/1.29
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://multiply.com/api/0.1">
<error>username and password do not match</error>
</response>
curl 'http://foonasty.multiply.com/api/mailbox.json?password=badpass'
{"error":"username and password do not match"}




api calls

/api/inbox read the inbox
/api/filters get inbox filters
/api/profile get a user's profile
/api/post post content
/api/read?type get a list of a user's content
/api/read?item_key read a specific item
/api/reply post a reply
/api/contacts get a list of contacts; edit contacts
/api/groups get a list of a user's group memberships
/api/invites view and manage invites
/api/relationships map of relationship types available on multiply
/api/existscheck if a photo or video exists in user's Media Locker

/api/inbox


http://foonasty.multiply.com/api/inbox?password=test&filter=recent&start=1

Requests to /api/inbox will return the the first 20 entries of a user's inbox using the user's default filter (as defined by the user on the web site). The type of content returned by /api/inbox may be modified using a “filter” argument. A list of valid filters for a given user may be collected by requesting /api/filters.


Advanced filtering options

Additionaly, mailbox content may be filtered by using any of these filter building blocks:

  • type limit entries by content type. Valid values are journal, photos, video, music, recipes, reviews, market, calendar, notes, guestbook, links or pms.
  • sort leave undefined for default sort. Set to "created" for reverse cronological order.
  • group return only group posts. Set to "all" for all groups or a comma delimited list of groups
  • fof set to 1 to return posts from friends of friends
  • undread set to 1 to return only unread posts
  • replied set to 1 to return only posts to which the user has replied

Paging through results

Requests to /inbox will return the first 25 entries in the inbox that match a given filter as well as a total_matching_filter field that documents the total number of messages available with that filter. To get the next 25 messages, set the start argument in the api request to 26, 51 and so on.



Returned data

Inboxes data is contains two top level nodes: total_matching_filter and messages. The total_matching_filter node has a sinlge interger. The messages node contains up to 25 individual message blocks.

<response>
   <total_matiching_filter>N</total_matching_filter>
    <messages>
         <message>
         ...

</message> </messages> </response>
“total_matching_filter”: N,
    “messages”: [
        {
            “name”:”message”,
            “value”: ...
        },
    ]
}


primary message fields
fielddata typedescription
message_idmultiply content id
$user_id:$type:$sequence_id
unique identifier of the message; used to request full version or to edit
subjecttextsubject of the message
summarytextsummary of the actual message
typejournal, photos, video, music, recipes, reviews, market, calendar, notes, guestbook, links or pmstype of post
htmlhtmlhtml representation of the post


all other message fields
fielddata typedescription
owner_idmultiply user iduser_id of the owner of the content.
author_idmultiply user iduser who authored the post; this might be distinct from the owner in that the owner can be a group
headshoturl100x100 headshot of author
thumbnailurlthumbnail if type is photos or video
content_type_iconurl16x16 gif of the content type's icon
num_photosintegernumber of photos associated with message
num_repliesintegernumber of replies to the message
replies_stringstringnicely formatted string indicated the number of replies, the number since last read, wand who made the reply
is_up_to_date1|0user has read the latest reply to the message
is_read1|0true is the user has read this message
is_subscribed1|0user has subscribed to receive email alerts for this message
is_sticky1|0user has flagged the message
first_unread_content_timestampseconds since epochtimestamp of the first unread content of the post; this could be the post itself or a reply the user has not yet seen
content_forhtmlhuman readable description of who the content is for, provided that the author of the messsage is the requesting uid.

rating1-5only used in reviews; how many stars out of five
last_read_timestampseconds since epochtimestamp when the message was last read by the user
latest_reply_user_idmultiply user iduser that last replied to the message
num_replies_at_last_readintegernumber of replies when the user last read
createdseconds since epochtimestamp when the message was created
start_prettymultiply pretty date formatonly used for calendar events; when the event starts
end_prettymultiply pretty date formatonly used in calendar events; when the event ends



/api/filters


http://foonasty.multiply.com/api/filters?password=test

Returns a list of email filters, each filter having two data nodes: name and label. Use the name node as an argument for the filter paramater when making inbox querries.

Returned data

Inboxes data is contains two top level nodes: total_matching_filter and messages. The total_matching_filter node has a sinlge interger. The messages node contains up to 25 individual message blocks.

<response>
    <filter>
        <name>recent</name>
        <label>Recent
Updates</label>
    </filter>
    ...
</response>
[
    { “name:”,”filter”, “value”: {“name”:”recent”,”label”:”Recent Updates”}},
    ...
]



/api/profile?user_id=$user_id

http://foonasty.multiply.com/api/profile?password=test&user_id=jill

Returns profile information for $user_id. Profile content is actualy dyamic, in that some users choose to share information with other users based on their relationship status.

profile fields
fieldvaluedescription
headshoturlurl for user's headshot
nametextuser's display name
possessive_nametextlocalized string to indicate ownership
relationshiptextrelationship of authenticated user to requested user
emailtextemail address of user
addressstringaddress of user
is_group0|1set to 1 if requested user_id is a group
num_contactsintegernumber of contacts user has
num_calendarintegernumber of calendars posted by user
num_marketintegernumber of market items posted by user
num_photosintergernumber of photo albums posted by user
num_groupsintegernumber of groups user belongs to
num_reviewsintegernumber of reviews posted by user
num_recipesintegernumber of recipes posted by user
num_notesintegernumber of notes posted by user
num_videointegernumber of videos posted by user
num_musicintegernumber of playlists posted by user
num_journalintegernumber or blog entries posted by user
num_linksintegernumber of links posted by user
guestbook_repliesintegernumber of replies in guestbook


<response>
    <num_photos>98</num_photos>
    <relationship>This is You</relationship>
    <num_calendar/>
    <num_market/>
    <num_contacts>1</num_contacts>
    <email>foonasty@mydomain.com</email> 
    <num_groups>7</num_groups>
    <address>Fort Lauderdale, FL </address>
    <num_reviews>1</num_reviews>
    <num_recipes/>
    <headshot> http://foonasty.multiply.com/logo </headshot> 
    <name>foonasty nasty</name>
    <possessive_name>foonasty's</possessive_name>
    <num_notes/>
    <num_video>7</num_video>
    <guestbook_replies>0</guestbook_replies>
    <num_music>37</num_music>
    <num_journal>35</num_journal>
    <num_links/>
</response>
{
    "num_photos":"98",
    "relationship":"This is You",
    "num_calendar":null,
    "num_market":null,
    "num_contacts":"1",
    "email":"foonasty@mydomain.com",
    "num_groups":7,"address":"Fort Lauderdale, FL ",
    "num_reviews":"1",
    "num_recipes":null,
    "headshot":"http://foonasty.multiply.com/logo",
    "name":"foonasty nasty",
    "possessive_name":"foonasty's",
    "num_notes":null,
    "num_video":"7",
    "guestbook_replies":0,
    "num_music":"37",
    "num_journal":"35",
    "num_links":null
}



/api/post


POST http://foonasty.multiply.com/api/post?password=test&type=photos&subject=foo+bar&...
Content-Type: multipart/form-data; boundary="_----------=_124933027215650"

--_----------=_124933027215650
Content-Length: 221080
Content-Type: image/jpeg
Content-Disposition: form-data; name="photo1"; filename="/net/paden/Pictures/IMG00015.JPG"

[PHOTO DATA]

--_----------=_124933046016124
Content-Length: 177515
Content-Type: image/jpeg
Content-Disposition: form-data; name="photo2"; filename="/net/paden/Pictures/IMG00008.JPG"

[PHOTO DATA]


Posting is accomplished by calling /api/post and sending the appropriate parameters for a given content type. If the content type supports attachements (such as photos, videos, cover shots for reviews, etc.), then files may be attached using the multipart/form-data posting method (similar to the upload box used in a web form).

Content type specific paramers are listed in sub-sections below. All content types support the following parameters:

common post parameters
fieldvaluedescription
typejournal, photos, video, music, recipes, reviews, market, calendar, notes, guestbook, links or pmstype of post
subjectfree form text with some limitations on css/javascriptsubject of post
bodyfree form text with some limitations on css/javascriptbody of post
tagscsv listtags
acl"everyone", "network" or "contacts" for posting to user accounts; "group:group-id" to post to a groupaccess control list shortcut for the post. Everyone means the post is public, network means it is for friends and friends of friends, and contacts means only people directly connected to the user will have access to the post. To post to group group-id, set this to group:group-id. Must be a member of the group and group settings must enable posting of the specific content type.
no_replies0|1set to 1 to disallow replies to a post
no_orders0|1do not allow other people to use media in post to place photo print orders
no_message_board0|1set to 1 to prevent post from being published to the message board
cp_facebook0|1if set to 1, will crosspost to user's facebook account
cp_twitter0|1if set to 1 will crosspost to user's twitter account
save"draft"normally undefined, if set to "draft" will put post in draft state


/api/post?type=photos

A successful photo post will return an HTTP status code of 200 as well as the album's item_key.

<response xmlns="http://multiply.com/api/0.1">
<item_key>376</item_key>
</response>
{"value":"377","name":"item_key"}


Photo Album Parameters
fieldvaluedescription
item_keymultiply item_keyunique identifier of item (i.e. foonasty:photos:12)
num_photosinteger; defaults to 20required if uploading more than 20 photos at a time
photoNphoto dataWhere N is an integer greater than 1. Photo data must be attached as a form-data field. It is suggested that user-facing applications upload one photo at a time in order to provide meaningful user feedback. This means a ten album photo album will post one photo with album subject and body information, then nine subsequent posts will add a single photo
photoN_subjectfree form textcaption for photo N
photoN_bodyfree form textdescription of photo N
to_media_lockerbooleanDefault: false. If true, the photo(s) are uploaded to user's Media Locker. If item_key and photoN_body parameters are specified, they are ignored. photoN_subject is used as the name for the photo in Media Locker.
folder_idstringrequired if to_media_locker is true. The folder in which the photo(s) are uploaded to. Similar to a path of a UNIX folder, without the leading / character. If a photo already exists in the Media Locker (as identified by the BASE64-MD5 string, see /api/exists method), the Media Locker folder-id for the photo is updated with the specified value.


/api/post?type=video

A successful video post will return an HTTP status code of 200 as well as the video_id.

<response xmlns="http://multiply.com/api/0.1">
<video_id>376</video_id>
</response>
{"value":"377","name":"video_id"}


Video Parameters
fieldvaluedescription
video_idnumeric video_id; combined with user id is a unique identifier for any given videoif present, the request will edit the subject and body for the video matching video_id.
videovideo dataVideo data must be attached as a form-data field.


/api/post?type=journal

A successful journal post will return an HTTP status code of 200 as well as the item_key.

<response xmlns="http://multiply.com/api/0.1">
<item_key>username:journal:376</item_key>
</response>
{"value":"username:journal:377","name":"item_key"}


journal parameters
fieldvaluedescription
item_idnumeric item_id; combined with user id is a unique identifier for any given journal entryif present, the request will edit the journal matching video_id.
attachment_NFile(s) to attach.Where N is an integer between 0 and 9. Attachments must be attached as a form-data field.
poll_questionfree form textif present, attaches a poll to this journal entry
poll_answer_Nfree form textWhere N is an integer between 0 and 9. If poll_question is defined, defines up to ten poll answers.


/api/post?type=note

A successful quicknote post will return an HTTP status code of 200 as well as the item_key. Please note: The entirety of a quicknote is contained in the "subject" portion. The "body" field is ignored.

<response xmlns="http://multiply.com/api/0.1">
<item_key>username:notes:376</item_key>
</response>
{"value":"username:notes:377","name":"item_key"}





/api/read?type=$type


curl 'http://foonasty.multiply.com/api/read?type=photos&password=test&start=1'
This method returns a listing of items for a specific item type. The type parameter must be present for a valid read request. Read will return the first 100 items in reverse cronological order of their creation dates. The returned data will also include a total number of listings available. If there are more then 100 available the next 100 can be requested by setting the "start" parameter to 101, then 201, etc.

Valid paramters to read are:
  • type - one of journal, photos, video, music, recipes, reviews, market, calendar, notes, guestbook, links or pms
  • item_key - the unique identier for a given item. item_keys are labeled as such in lists returned from reads or inbox queries.
  • start - integer; return reads starting at that offset.


<total_items>N</total_items>
<items><
    <item>
    ...
    </item>
    <item>
    ...
    </item>
    .
    .
    .
</items>


Each item node will be stuctured as follows:
/read type request -- items list
fieldvaluedescription
item_keymultiply item_keyunique identifier of item
subjecttextsubject of the item
summarytextfirst 100 characters of body of post
num_repliesintegernumber of replies to post
num_photosintegernumber of photos available with item
thumbnailsmultiply thumbnail arraysee thumbnails section for complete description; any thumbail image associated with the item, such as a cover photo or first frame of video
tagscsv valuescomma separated list of user defined tags applied to this item





/api/read?item_key=$item_key


curl 'http://foonasty.multiply.com/api/read?item_key=foonasty:photos:1&password=test'


This method returns a detailed description of a specific item. Item_key or type must be present for a valid read request. All item_key requests will return the fields listed below.

/read item_key request
fieldvaluedescription
subjecttextsubject of the item
bodytextbody of the item; if recipe is the description
author_idmultiply user_idauthor_id for the item
author_namelocalized first name, last nameauthor's real name
acl_descriptiontextplain english description for the items access control list
created_datemultiply date formathuman readable creation time for item
created_date_unixunix timestampcreation time in seconds since the epoch
num_repliesintegernumber of replies to post


Depending on the item type, there will be additional fields.

photos

Photos will have an additional "photos" node that will contain an array of photo hashes. Each hash will have the following fields:
photo hash elements
fieldvaluedescription
srcurlurl of the largest available size
item_keymultiply item_keyunique identifier of the photo
heightintegerpixel height of image
widthintegerpixel width of image
captiontextcaption
descriptiontextfull description of photo, often undefined by the user
num_repliesintegernumber of replies to this particular photo
thumbnailsmultiply thumbnail arraysee thumbnails section for complete description; listing of all available sizes of the photo

videos

additional video fields
fieldvaluedescription
thumbnailsmultiply thumbnail arraycover photo for the video, often the first frame.
iphone_srcurlurl for iphone compatible video stream
srcurlurl for video stream
heightintegerpixel height of video
widthintegerpixel width of video

music

Music items will potentially have a pictures array. They will also have an additional "songs" node that will contain an array of song hashes. Each song hash will have the following fields:
song hash elements
fieldvaluedescription
srcurlurl for the song stream
titletextsong title
artisttextsong artist
albumtextsong album

calendar

additional calendar fields
fieldvaluedescription
start_dateyyyymmddstart date for the event
start_timehh:mmstart time for the event
end_dateyyyymmddend date for the event
end_timehh:mmend time for the event
locationtextlocation of the event

reviews

additional review fields
fieldvaluedescription
categorytextcategory - for category "Books" this will be the genre; "Computers & Electronics": Product Type; "Movies": Genre; "Music": Genre; "Restaurants": Cuisine; "Video Games": Genre
consoletextgaming console; only defined for reviews with category "Video Games"
book_authortextbook author; only defined for reviews with category "Books"
artisttextartist; only defined for reviews with category "Music"
manufacturertextmanufacturer of item; only defined for reviews with category "Computers & Electronics"
locationtextlocation of restaurant; only defined for reviews with category "Restaurants"
picturesmultiply picture arraypictures attached by user

links

additional links fields
fieldvaluedescription
urlurlthe link itself
picturesmultiply picture arraypictures attached by user

market

additional market fields
categorytextcategory of item for sale
pricetextprice of item; may be non-numeric
buy_or_sellbuy|sellbuy indicates user wants to buy item described; sell means it is for sale
picturesmultiply picture arraypictures attached by user

recipes

additional recipe fields
categorytextfood type of recipe, i.e. "appetizer", "baking", etc.
styletextstyle of food
special_considerationstextspecial consideration, such as "kosher, "kids", etc.
servingstextnumber of servings, although can be non-numeric
ingredientstextingredients
directionstextdirections
picturesmultiply picture arraypictures attached by user

multiply picture array

A pictures array is optionally included with certain data types. This array will contain one or more picture hashes with the following fields:
picture hash
fieldvaluedescription
srcurlurl of the largest available size
heightintegerpixel height of image
widthintegerpixel width of image
thumbnailsmultiply thumbnail arrayall other available sizes of the image

multiply thumbnail array

A thumbnail array contains one or more thumbnail hashes with the following fields:
thumbnail hash
fieldvaluedescription
srcurlurl of the image
heightintegerpixel height of image
widthintegerpixel width of image



/api/reply


POST http://foonasty.multiply.com/api/reply?password=test&item_key=barnasty:photos:1:2&body=I%20like%20this%20photo&...


Replying to an item is accomplished by calling /api/reply and sending the appropriate parameters for a given content type. Replies may be made to an item itself (An album or an individual photo in the case of photos) or to a reply on an item. Replies contain a body, but no subject. Replies may optionally quote the item they are replying to or a portion thereof, but the quote must be unaltered from the original item body or reply body.

Common Reply Parameters
fieldvaluedescription
item_keymultiply item_keyAll replies must reference an item key
reply_tointegerreply_id this reply is in response to (optional)
bodyfree form text with some limitations on css/javascriptbody of reply
quotetextportion of parent reply or item body to quote


Review Parameters
fieldvaluedescription
ratinginteger 1-5If present, attaches a one to five star rating to this reply.

/api/contacts

http://foonasty.multiply.com/api/contacts?password=test
Returns and array of a users contacts. The array contains one contacts hash for each user.
<response>
    <contacts>
         <contact>
         ...

</contact> </contacts> </response>
    “contacts”: [
        {
            “name”:”contact”,
            “value”: ...
        },
    ]
}
contact hash
fieldvaluedescription
first_namestringfirst name
last_namestringlast name
user_idmultiply user idup to 20 character unique identifier
headshoturlurl to 100x100 gif of user's headshot
user_siteurlurl to user's site

/api/exists

curl 'http://foonasty.multiply.com/api/exists?password=test&base64_md5=BASE64-MD5-STRING-OF-MEDIA&\
                                              file_size=SIZE-IN-BYTES&folder_id=FOLDER-ID&file_name=FILE-NAME'

This method checks if the photo or video file identified the BASE64-MD5 string and the filesize already exists in the user's Media Locker. The folder_id and file_name parameters are optional. If one or both are specified and are different from the Media Locker info of the existing photo/video, the info in the Media Locker is updated to the specified value(s).

The BASE64-MD5 is calculated by concatenating the first 1000 bytes, middle 1000 bytes [starting at offset ceil(photo_size_in_bytes/2)] and the last 1000 bytes, and then calculating the Base64 encoded string of the MD5 digest (see Digest::MD5::md5_base64, for example)

<response>
   <exists>true-or-false</exists>
</response>