Revver Developer Center: Api : Xml

Revver Developer Center

API Specification.XML-RPC



Overview

The Revver XML-RPC API provides a comprehensive set of functions for creating, managing and updating videos and users. The XMl-RPC API requires authentication, whereas the JSON API does not. While authenticated, certain access restrictions are maintained, and users cannot access certain types of protected and private data not owned by one of their child users.

Description

XML-RPC is a simple way to submit and receive complex sets of data via text over the internet. Other "web services" standards such as SOAP have heavier implementation requirements, and REST is generally not secure enough to transport sensitive data streams. The XML-RPC specification requires that variables are "encoded" into XML along with their data-type. The process is actually very simple and there are a number of lightweight libraries capable of handling this process seamlessly. The best place to start for new XML-RPC users is with the XML-RPC Homepage

The Revver XML-RPC API url is: https://api.revver.com/xml/1.0. Authentication is done by passing the username and password within the URL. Because this URL is called from the code level, it is not easily visible to prying eyes.

See the example below (written in Python for readability) for more details

Example

import xmlrpclib

api = xmlrpclib.Server('https://api.revver.com/xml/1.0?login=username&passwd=password')

# Create new video upload token (token/video owner will be 'joe@username' - a valid child user of the authenticated user)
token = api.video.getUploadTokens(1,['owner':'joe'])

# Create a New Video (you still must upload the physical video for it to show up in search) using that token.
videoId = api.video.create(token,"My Awesome Video", ['awesome','funny','revver'], 2, {'description':'The Most awesome video ever posted to Revver', 'author':'Joe', 'credits':'directed by Joe'})

# Return all videos owned by HappySlip
# (if a URL is requested as a reutrn field, the
#  authenticated user's account ID will be returned as affiliate)
results = api.video.find({'owners':['HappySlip']},['id','title'],{'count':True})

# Return all videos (loop through entire resultset until all results are returned)
# within the "comedy" category on the revver.com site"
# Note: Revver.com uses "tags" (see article: Tags) for the sitewide categorization.
final = False
offset = 0
limit = 500
total = 0
while not final:
    results = api.video.find({'owners':['HappySlip']},['id','title'],{'count':True, 'final':True, 'offset':offset, 'limit':limit})
    for video in results['result']
        print "ID: %s -- Title: %s " %( str(video['id']), video['title'])
    final = results['final']
    offset += limit
    total = results['count']

# Update video ID 12345 w/ a New Title and Description (will leave everything else the same).
status = api.video.update(12345,{'title':'My New Title', 'description':'My New Description'})

# Find all users with "revver" anywhere in the login or email
results = api.user.find({'search':'revver')

# Get user details for userID 12345
returnFields = ['description', 'lastUploadDate', 'email', 'login']
results = api.user.get(67890, returnFields)

# Set the description for user: joesmith (assumes joesmith is child-user of authenticated user)
status = api.user.update('joesmith', {'description':'Another super talented revver user'})