Skip to content
Timothy Duffy edited this page Jul 9, 2014 · 60 revisions

##API Documentation##

###uploadmedia.json###

HTTP POST:

<form action="/uploadmedia.json" method="post" accept-charset="utf-8" enctype="multipart/form-data">

    <input id="clientid" name="clientid" type="text" value="<clientid>" />
    <input id="mediatype" name="mediatype" type="text" value="<mediatype>">

    <input id="mediafile" name="mediafile" type="file" value="<filename>" /> <!-- optional -->
    <input id="mediatext" name="mediatext" type="text" value=""> <!-- optional -->
    <input id="mediacaption" name="mediacaption" type="text" value=""> <!-- optional -->

    <input type="submit" value="submit" />
</form>

Field Descriptions:

clientid:
    This is the unique id of the client.  This is a uuid that is generated by the client and is associated
    with a user within the database.  Event if a user is 'validated' their unique clientid is still used
    to identify them.

mediatype:
    This field holds the type of the media.  Valid types include:

        text - a text post.  there is no limit on it's length.
        audio - an audio recording (should be in mp3 format)
        video - a video recording (should be in mpg format)
        image - an image (should be in jpg format)

    If a mediatype of 'text' is used, then the mediatext field must contain a non-zero length string.  If
    any other mediatype is used, then the mediafile field must contain file data.  Not following these
    rules will produce a { "success": false } response.


mediafile:

    This is of type file, and will be the media object that is being uploaded.  This is an optional field,
    but the mediatype filed must be 'text' if this is not included, else { "success": false } will be 
    returned.

mediatext

    This is of type text, and will hold the text of the media post.  This is an optional field, but the
    mediatype field must be 'audio', 'video', or 'image' if this is not include, else a 
    { "success": false } will be returned.

mediacaption

    This is of type text, and will hold an additional description of the media type.  This is an optional
    and does not need to be included.

Response:

Successful upload:

    {"mediaid": "4ebbb6c0-bd4c-43fc-8242-5aec49989f61", "success": true}

Unsuccessful upload:

    { "success": false }

Clone this wiki locally