Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit be70b5d6643100013b7b9692e5cb276a06f50b69 0 parents
@precision precision authored
4 .gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+config.json
+logs/*
+pids/*
61 api_configuration_standard.json
@@ -0,0 +1,61 @@
+{
+ "endPoints": [
+ {
+ "path": "/word.{format}/{word}",
+ "description": "",
+ "operations": [
+ {
+ "category": "WordDetails", // Group using this or endpoint?
+ "summary": "Given a word as a string, returns the WordObject that represents it",
+ "suggestedName": "getWord",
+ "deprecated": false, // need to add
+ "open": false,
+ "httpMethod": "GET",
+ "parameters": [
+ {
+ "name": "word",
+ "description": "String value of WordObject to return",
+ "required": true,
+ "dataType": "string",
+ "paramType": "path" // Needed?
+ },
+ {
+ "name": "useCanonical",
+ "description": "If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.",
+ "required": false,
+ "dataType": "string",
+ "paramType": "query"
+ },
+ {
+ "name": "includeSuggestions",
+ "description": "Return suggestions (for correct spelling, case variants, etc.)",
+ "required": false,
+ "dataType": "string",
+ "paramType": "query"
+ },
+ {
+ "name": "format",
+ "defaultValue": "json", // need to add
+ "description": "API response format",
+ "required": true,
+ "allowableValues": "json,xml", // Need to add
+ "paramType": "path"
+ }
+ ],
+ "response": [
+ {
+ "valueType": "wordObject",
+ "errorResponses": [ // Needed?
+ {
+ "reason": "Invalid word supplied.",
+ "code": 400
+ }
+ ],
+ "condition": "any"
+ }
+ ],
+ "examples": [ // Fill out
+ ]
+ }
+ ]
+ },
625 app.js
@@ -0,0 +1,625 @@
+//
+// Copyright (c) 2011 Mashery, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// 'Software'), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+//
+// Module dependencies
+//
+var express = require('express'),
+ util = require('util'),
+ fs = require('fs'),
+ OAuth = require('oauth').OAuth,
+ query = require('querystring'),
+ url = require('url'),
+ http = require('http'),
+ redis = require('redis'),
+ RedisStore = require('connect-redis')(express),
+ hashlib = require('hashlib');
+
+// Configuration
+try {
+ var configJSON = fs.readFileSync(__dirname + "/config.json")
+ var config = JSON.parse(configJSON.toString())
+} catch(e) {
+ sys.puts("File config.json not found or is invalid. Try: `cp config.json.sample config.json`")
+ process.exit(1)
+}
+
+//
+// Redis connection
+//
+var defaultDB = '0';
+var db = redis.createClient(config.redis.port, config.redis.host);
+db.auth(config.redis.password);
+
+// Select our DB
+db.on("connect", function() {
+ db.select(defaultDB);
+ db.get("livedocs", function(err, reply) {
+ if (config.debug) {
+ console.log('Selected db \''+ defaultDB + '\' named \'' + reply + '\'');
+ }
+ });
+});
+
+db.on("error", function(err) {
+ if (config.debug) {
+ console.log("Error " + err);
+ }
+});
+
+//
+// Load API Configs
+//
+var apisConfig;
+fs.readFile('public/data/apiconfig.json', 'utf-8', function(err, data) {
+ if (err) throw err;
+ apisConfig = JSON.parse(data);
+ if (config.debug) {
+ console.log(util.inspect(apisConfig));
+ }
+});
+
+var app = module.exports = express.createServer();
+
+app.configure(function() {
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'jade');
+ app.use(express.logger());
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(express.cookieParser());
+ app.use(express.session({
+ secret: config.sessionSecret,
+ store: new RedisStore({
+ 'host': config.redis.host,
+ 'port': config.redis.port,
+ 'pass': config.redis.password,
+ 'maxAge': 1209600000
+ })
+ }));
+
+ app.use(app.router);
+
+ app.use(express.static(__dirname + '/public'));
+});
+
+app.configure('development', function() {
+ app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
+});
+
+app.configure('production', function() {
+ app.use(express.errorHandler());
+});
+
+//
+// Middleware
+//
+function oauth(req, res, next) {
+ console.log('OAuth process started');
+ var apiName = req.body.apiName,
+ apiConfig = apisConfig[apiName];
+
+ if (apiConfig.auth.oauth) {
+ var apiKey = req.body.apiKey || req.body.key,
+ apiSecret = req.body.apiSecret || req.body.secret,
+ refererURL = url.parse(req.headers.referer),
+ callbackURL = refererURL.protocol + '//' + refererURL.host + '/authSuccess/' + apiName,
+ oa = new OAuth(apiConfig.auth.oauth.requestURL,
+ apiConfig.auth.oauth.accessURL,
+ apiKey,
+ apiSecret,
+ apiConfig.auth.oauth.version,
+ callbackURL,
+ apiConfig.auth.oauth.crypt);
+
+ if (config.debug) {
+ console.log('OAuth type: ' + apiConfig.auth.oauth.type);
+ console.log('Method security: ' + req.body.oauth);
+ console.log('Session authed: ' + req.session[apiName]);
+ console.log('apiKey: ' + apiKey);
+ console.log('apiSecret: ' + apiSecret);
+ };
+
+ // Check if the API even uses OAuth, then if the method requires oauth, then if the session is not authed
+ if (apiConfig.auth.oauth.type == 'three-legged' && req.body.oauth == 'authrequired' && (!req.session[apiName] || !req.session[apiName].authed) ) {
+ if (config.debug) {
+ console.log('req.session: ' + util.inspect(req.session));
+ console.log('headers: ' + util.inspect(req.headers));
+
+ console.log(util.inspect(oa));
+ // console.log(util.inspect(req));
+ console.log('sessionID: ' + util.inspect(req.sessionID));
+ // console.log(util.inspect(req.sessionStore));
+ };
+
+ oa.getOAuthRequestToken(function(err, oauthToken, oauthTokenSecret, results) {
+ if (err) {
+ res.send("Error getting OAuth request token : " + util.inspect(err), 500);
+ } else {
+ // Unique key using the sessionID and API name to store tokens and secrets
+ var key = req.sessionID + ':' + apiName;
+
+ db.set(key + ':apiKey', apiKey, redis.print);
+ db.set(key + ':apiSecret', apiSecret, redis.print);
+
+ db.set(key + ':requestToken', oauthToken, redis.print);
+ db.set(key + ':requestTokenSecret', oauthTokenSecret, redis.print);
+
+ // Set expiration to same as session
+ db.expire(key + ':apiKey', 1209600000);
+ db.expire(key + ':apiSecret', 1209600000);
+ db.expire(key + ':requestToken', 1209600000);
+ db.expire(key + ':requestTokenSecret', 1209600000);
+
+ // res.header('Content-Type', 'application/json');
+ res.send({ 'signin': apiConfig.auth.oauth.signin + oauthToken });
+ }
+ });
+ } else if (apiConfig.auth.oauth.type == 'two-legged' && req.body.oauth == 'authrequired') {
+ // Two legged stuff... for now nothing.
+ next();
+ } else {
+ next();
+ }
+ } else {
+ next();
+ }
+
+}
+
+//
+// OAuth Success!
+//
+function oauthSuccess(req, res, next) {
+ var oauthRequestToken,
+ oauthRequestTokenSecret,
+ apiKey,
+ apiSecret,
+ apiName = req.params.api,
+ apiConfig = apisConfig[apiName],
+ key = req.sessionID + ':' + apiName; // Unique key using the sessionID and API name to store tokens and secrets
+
+ if (config.debug) {
+ console.log('apiName: ' + apiName);
+ console.log('key: ' + key);
+ console.log(util.inspect(req.params));
+ };
+
+ db.mget([
+ key + ':requestToken',
+ key + ':requestTokenSecret',
+ key + ':apiKey',
+ key + ':apiSecret'
+ ], function(err, result) {
+ if (err) {
+ console.log(util.inspect(err));
+ }
+ oauthRequestToken = result[0],
+ oauthRequestTokenSecret = result[1],
+ apiKey = result[2],
+ apiSecret = result[3];
+
+ if (config.debug) {
+ console.log(util.inspect(">>"+oauthRequestToken));
+ console.log(util.inspect(">>"+oauthRequestTokenSecret));
+ console.log(util.inspect(">>"+req.query.oauth_verifier));
+ };
+
+ var oa = new OAuth(apiConfig.auth.oauth.requestURL,
+ apiConfig.auth.oauth.accessURL,
+ apiKey,
+ apiSecret,
+ apiConfig.auth.oauth.version,
+ null,
+ apiConfig.auth.oauth.crypt);
+
+ if (config.debug) {
+ console.log(util.inspect(oa));
+ };
+
+ oa.getOAuthAccessToken(oauthRequestToken, oauthRequestTokenSecret, req.query.oauth_verifier, function(error, oauthAccessToken, oauthAccessTokenSecret, results) {
+ if (error) {
+ res.send("Error getting OAuth access token : " + util.inspect(error) + "["+oauthAccessToken+"]"+ "["+oauthAccessTokenSecret+"]"+ "["+util.inspect(results)+"]", 500);
+ } else {
+ if (config.debug) {
+ console.log('results: ' + util.inspect(results));
+ };
+ db.mset([key + ':accessToken', oauthAccessToken,
+ key + ':accessTokenSecret', oauthAccessTokenSecret
+ ], function(err, results2) {
+ req.session[apiName] = {};
+ req.session[apiName].authed = true;
+ if (config.debug) {
+ console.log('session[apiName].authed: ' + util.inspect(req.session));
+ };
+
+ next();
+ });
+ }
+ });
+
+ });
+}
+
+//
+// processRequest - handles API call
+//
+function processRequest(req, res, next) {
+ if (config.debug) {
+ console.log(util.inspect(req.body, null, 3));
+ };
+
+ var reqQuery = req.body,
+ params = reqQuery.params || {},
+ methodURL = reqQuery.methodUri,
+ httpMethod = reqQuery.httpMethod,
+ apiKey = reqQuery.apiKey,
+ apiSecret = reqQuery.apiSecret,
+ apiName = reqQuery.apiName
+ apiConfig = apisConfig[apiName],
+ key = req.sessionID + ':' + apiName;
+
+ // Replace placeholders in the methodURL with matching params
+ for (var param in params) {
+ if (params.hasOwnProperty(param)) {
+ if (params[param] !== '') {
+ // URL params are prepended with ":"
+ var regx = new RegExp(':' + param);
+
+ // If the param is actually a part of the URL, put it in the URL and remove the param
+ if (!!regx.test(methodURL)) {
+ methodURL = methodURL.replace(regx, params[param]);
+ delete params[param]
+ }
+ } else {
+ delete params[param]; // Delete blank params
+ }
+ }
+ }
+
+ var paramString = query.stringify(params),
+ privateReqURL = apiConfig.baseURL + apiConfig.privatePath + methodURL + '?' + paramString;
+ options = {
+ headers: {},
+ host: apiConfig.baseURL,
+ method: httpMethod,
+ path: apiConfig.publicPath + methodURL + '?' + paramString
+ };
+
+ if (apiConfig.auth.oauth) {
+ console.log('Using OAuth');
+
+ // Three legged OAuth
+ if (apiConfig.auth.oauth.type == 'three-legged' && (reqQuery.oauth == 'authrequired' || (req.session[apiName] && req.session[apiName].authed))) {
+ if (config.debug) {
+ console.log('Three Legged OAuth');
+ };
+
+ db.mget([key + ':apiKey',
+ key + ':apiSecret',
+ key + ':accessToken',
+ key + ':accessTokenSecret'
+ ],
+ function(err, results) {
+
+ var apiKey = reqQuery.apiKey || results[0],
+ apiSecret = reqQuery.apiSecret || results[1],
+ accessToken = results[2],
+ accessTokenSecret = results[3];
+
+ var oa = new OAuth(apiConfig.auth.oauth.requestURL || null,
+ apiConfig.auth.oauth.accessURL || null,
+ apiKey || null,
+ apiSecret || null,
+ apiConfig.auth.oauth.version || null,
+ null,
+ apiConfig.auth.oauth.crypt);
+
+ if (config.debug) {
+ console.log('Access token: ' + accessToken);
+ console.log('Access token secret: ' + accessTokenSecret);
+ console.log('key: ' + key);
+ };
+
+ oa.getProtectedResource(privateReqURL, httpMethod, accessToken, accessTokenSecret, function (error, data, response) {
+ req.call = privateReqURL;
+
+ // console.log(util.inspect(response));
+ if (error) {
+ console.log('Got error: ' + util.inspect(error));
+
+ if (error.data == 'Server Error' || error.data == '') {
+ req.result = 'Server Error';
+ } else {
+ req.result = error.data;
+ }
+
+ res.statusCode = error.statusCode
+
+ next();
+ } else {
+ req.resultHeaders = response.headers;
+ req.result = JSON.parse(data);
+
+ next();
+ }
+ });
+ }
+ );
+ } else if (apiConfig.auth.oauth.type == 'two-legged' && reqQuery.oauth == 'authrequired') { // Two-legged
+ if (config.debug) {
+ console.log('Two Legged OAuth');
+ };
+
+ var body,
+ oa = new OAuth(null,
+ null,
+ apiKey || null,
+ apiSecret || null,
+ apiConfig.auth.oauth.version || null,
+ null,
+ apiConfig.auth.oauth.crypt);
+
+ var resource = options.host + options.path,
+ cb = function(error, data, response) {
+ if (error) {
+ if (error.data == 'Server Error' || error.data == '') {
+ req.result = 'Server Error';
+ } else {
+ console.log(util.inspect(error));
+ body = error.data;
+ }
+
+ res.statusCode = error.statusCode;
+
+ } else {
+ console.log(util.inspect(data));
+
+ var responseContentType = response.headers['content-type'];
+
+ switch (true) {
+ case /application\/javascript/.test(responseContentType):
+ case /text\/javascript/.test(responseContentType):
+ case /application\/json/.test(responseContentType):
+ body = JSON.parse(data);
+ break;
+ case /application\/xml/.test(responseContentType):
+ case /text\/xml/.test(responseContentType):
+ default:
+ }
+ }
+
+ // Set Headers and Call
+ if (response) {
+ req.resultHeaders = response.headers || 'None';
+ } else {
+ req.resultHeaders = req.resultHeaders || 'None';
+ }
+
+ req.call = url.parse(options.host + options.path);
+ req.call = url.format(req.call);
+
+ // Response body
+ req.result = body;
+
+ next();
+ };
+
+ switch (httpMethod) {
+ case 'GET':
+ console.log(resource);
+ oa.get(resource, '', '',cb);
+ break;
+ case 'PUT':
+ case 'POST':
+ oa.post(resource, '', '', JSON.stringify(obj), null, cb);
+ break;
+ case 'DELETE':
+ oa.delete(resource,'','',cb);
+ break;
+ }
+
+ } else {
+ // API uses OAuth, but this call doesn't require auth and the user isn't already authed, so just call it.
+ unsecuredCall();
+ }
+ } else {
+ // API does not use authentication
+ unsecuredCall();
+ }
+
+ // Unsecured API Call helper
+ function unsecuredCall() {
+ console.log('Unsecured Call');
+
+ // Add API Key to params, if any.
+ if (apiKey != '') {
+ options.path += '&' + apiConfig.keyParam + '=' + apiKey;
+ }
+
+ // Perform signature routine, if any.
+ if (apiConfig.signature) {
+ if (apiConfig.signature.type == 'signed_md5') {
+ // Add signature parameter
+ var timeStamp = Math.round(new Date().getTime()/1000);
+ var sig = hashlib.md5('' + apiKey + apiSecret + timeStamp + '', { asString: true });
+ options.path += '&' + apiConfig.signature.sigParam + '=' + sig;
+ }
+ else if (apiConfig.signature.type == 'signed_sha256') { // sha256(key+secret+epoch)
+ // Add signature parameter
+ var timeStamp = Math.round(new Date().getTime()/1000);
+ var sig = hashlib.sha256('' + apiKey + apiSecret + timeStamp + '', { asString: true });
+ options.path += '&' + apiConfig.signature.sigParam + '=' + sig;
+ }
+ }
+
+ // Setup headers, if any
+ if (reqQuery.headerNames && reqQuery.headerNames.length > 0) {
+ if (config.debug) {
+ console.log('Setting headers');
+ };
+ var headers = {};
+
+ for (var x = 0, len = reqQuery.headerNames.length; x < len; x++) {
+ if (config.debug) {
+ console.log('Setting header: ' + reqQuery.headerNames[x] + ':' + reqQuery.headerValues[x]);
+ };
+ if (reqQuery.headerNames[x] != '') {
+ headers[reqQuery.headerNames[x]] = reqQuery.headerValues[x];
+ }
+ }
+
+ options.headers = headers;
+ }
+
+ if (!options.headers['Content-Length']) {
+ options.headers['Content-Length'] = 0;
+ }
+
+ if (config.debug) {
+ console.log(util.inspect(options));
+ };
+
+ // API Call. response is the response from the API, res is the response we will send back to the user.
+ var apiCall = http.request(options, function(response) {
+ response.setEncoding('utf-8');
+ if (config.debug) {
+ console.log('HEADERS: ' + JSON.stringify(response.headers));
+ console.log('STATUS CODE: ' + response.statusCode);
+ };
+
+ res.statusCode = response.statusCode;
+
+ var body = '';
+
+ response.on('data', function(data) {
+ body += data;
+ })
+
+ response.on('end', function() {
+ delete options.agent;
+
+ var responseContentType = response.headers['content-type'];
+
+ switch (true) {
+ case /application\/javascript/.test(responseContentType):
+ case /application\/json/.test(responseContentType):
+ console.log(util.inspect(body));
+ // body = JSON.parse(body);
+ break;
+ case /application\/xml/.test(responseContentType):
+ case /text\/xml/.test(responseContentType):
+ default:
+ }
+
+ // Set Headers and Call
+ req.resultHeaders = response.headers;
+ req.call = url.parse(options.host + options.path);
+ req.call = url.format(req.call);
+
+ // Response body
+ req.result = body;
+
+ console.log(util.inspect(body));
+
+ next();
+ })
+ }).on('error', function(e) {
+ if (config.debug) {
+ console.log('HEADERS: ' + JSON.stringify(res.headers));
+ console.log("Got error: " + e.message);
+ console.log("Error: " + util.inspect(e));
+ };
+ });
+
+ apiCall.end();
+ }
+}
+
+// Dynamic Helpers
+// Passes variables to the view
+app.dynamicHelpers({
+ session: function(req, res) {
+ return req.session;
+ },
+ apiInfo: function(req, res) {
+ if (req.params.api) {
+ return apisConfig[req.params.api];
+ } else {
+ return apisConfig;
+ }
+ },
+ apiName: function(req, res) {
+ if (req.params.api) {
+ return req.params.api;
+ }
+ },
+ apiDefinition: function(req, res) {
+ if (req.params.api) {
+ var data = fs.readFileSync('public/data/' + req.params.api + '.json');
+ return JSON.parse(data);
+ }
+ }
+})
+
+//
+// Routes
+//
+app.get('/', function(req, res) {
+ res.render('listAPIs', {
+ title: config.title
+ });
+});
+
+// Process the API request
+app.post('/processReq', oauth, processRequest, function(req, res) {
+ var result = {
+ headers: req.resultHeaders,
+ response: req.result,
+ call: req.call
+ };
+
+ res.send(result);
+});
+
+// Just auth
+app.all('/auth', oauth);
+
+// OAuth callback page, closes the window immediately after storing access token/secret
+app.get('/authSuccess/:api', oauthSuccess, function(req, res) {
+ res.render('authSuccess', {
+ title: 'OAuth Successful'
+ });
+});
+
+// API shortname, all lowercase
+app.get('/:api([^\.]+)', function(req, res) {
+ res.render('api');
+});
+
+// Only listen on $ node app.js
+
+if (!module.parent) {
+ app.listen(config.port);
+ console.log("Express server listening on port %d", app.address().port);
+}
12 config.json.sample
@@ -0,0 +1,12 @@
+{
+ "title" : "I/O Docs - http://github.com/mashery/iodocs.git",
+ "port" : 3000,
+ "debug" : false,
+ "sessionSecret" : "12345",
+ "redisConfig" : {
+ "host" : "localhost",
+ "port" : 6379,
+ "password" : "",
+ "database" : "0"
+ }
+}
37 package.json
@@ -0,0 +1,37 @@
+{
+ "name": "iodocs",
+ "version": "0.0.1",
+ "description": "Live API Documentation and Browsing",
+ "homepage": "http://mashery.com",
+ "keywords": [
+ "livedocs",
+ "iodocs",
+ "documentation",
+ "api"
+ ],
+ "author": "Mashery, Inc. <nmansilla@mashery.com>",
+ "contributors": [
+ "Kelly Miyashiro <kelly@mashery.com.com>",
+ "Neil Mansilla <neil@mashery.com>",
+ "Mike Squires <msquires@mashery.com>",
+ "Uriah Welcome <uriah@mashery.com>"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mashery/iodocs.git"
+ },
+ "dependencies": {
+ "connect-redis": "1.0.6",
+ "express": "2.4.3",
+ "hashlib": "1.0.1",
+ "jade": "0.13",
+ "oauth": "0.9.3",
+ "querystring": "0.0.1",
+ "redis": "0.6.6"
+ },
+ "devDependencies": {},
+ "main": "index",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+}
42 public/data/apiconfig.json
@@ -0,0 +1,42 @@
+{
+ "simplegeo": {
+ "name": "Simplegeo",
+ "baseURL": "api.simplegeo.com",
+ "publicPath": "",
+ "auth": {
+ "oauth": {
+ "type": "two-legged",
+ "version": "1.0",
+ "crypt": "HMAC-SHA1"
+ }
+ }
+ },
+ "usatoday": {
+ "name": "USA TODAY",
+ "baseURL": "api.usatoday.com",
+ "publicPath": "/open",
+ "auth": "key",
+ "keyParam": "api_key"
+ },
+ "klout": {
+ "name": "Klout",
+ "baseURL": "api.klout.com",
+ "publicPath": "/1",
+ "auth": "key",
+ "keyParam": "key"
+ },
+ "fanfeedr": {
+ "name": "FanFeedr",
+ "baseURL": "ffapi.fanfeedr.com",
+ "publicPath": "",
+ "auth": "key",
+ "keyParam": "api_key"
+ },
+ "rotten": {
+ "name": "Tomatoes",
+ "baseURL": "api.rottentomatoes.com",
+ "publicPath": "/api/public/v1.0",
+ "auth": "key",
+ "keyParam": "apikey"
+ }
+}
1,537 public/data/fanfeedr.json
@@ -0,0 +1,1537 @@
+{
+ "endpoints":[
+ {
+ "name":"Leagues",
+ "methods":[
+ {
+ "MethodName":"leagues",
+ "Synopsis":"This collection method returns a list of league ids and names.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/leagues",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"basic",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ }
+ ]
+ },
+ {
+ "MethodName":"leagues/:id",
+ "Synopsis":"Returns detailed information about a single league member, specified by the id parameter below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/leagues/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of desired league"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Conferences",
+ "methods":[
+ {
+ "MethodName":"conferences",
+ "Synopsis":"This collection method returns a list of league ids and names..",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/conferences",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of desired resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"conferences/:id",
+ "Synopsis":"Returns detailed information about a single conference member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/conferences/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired conference"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of desired resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Divisions",
+ "methods":[
+ {
+ "MethodName":"divisions",
+ "Synopsis":"This collection method returns a list of division ids and names, specified by the parent_resource and resource_id parameters belows.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/divisions",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"divisions/:id",
+ "Synopsis":"Returns detailed information about a single division member, specified by the parameters below..",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/divisions/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired divsion"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Teams",
+ "methods":[
+ {
+ "MethodName":"teams",
+ "Synopsis":"This collection method returns a list of team ids and names, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/teams",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"teams/:id",
+ "Synopsis":"Returns detailed information about a single team member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/teams/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired team"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"teams/:id/roster",
+ "Synopsis":"Returns a player roster for a single team member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/teams/:id/roster",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired team"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Persons",
+ "methods":[
+ {
+ "MethodName":"persons",
+ "Synopsis":"This collection method returns a list of person ids and names, specified by the parent_resource and resource_id parameters belows.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/persons",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"persons/:id",
+ "Synopsis":"Returns detailed information about a single team member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/persons/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired person"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Geo",
+ "methods":[
+ {
+ "MethodName":"geo",
+ "Synopsis":"This collection method returns a list of locations and ids, specified by a lat and long or query.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/geo",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"lat",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"Latitude"
+ },
+ {
+ "Name":"lon",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"Longitude"
+ },
+ {
+ "Name":"q",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"Free-text geo-based query term"
+ }
+ ]
+ },
+ {
+ "MethodName":"geo/:id",
+ "Synopsis":"Returns detailed information about a single location member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/geo/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired geo resource (ex: 399 for Denver, 609 for Detroit)"
+ }
+ ]
+ },
+ {
+ "MethodName":"geo/:id/teams",
+ "Synopsis":"This collection action returns a list of teams and ids for a given location.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/geo/:id/teams",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired geo resource (ex: 399 for Denver, 609 for Detroit)"
+ }
+ ]
+ },
+ {
+ "MethodName":"geo/:id/content",
+ "Synopsis":"This collection action returns a list of content items and ids for a given location.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/geo/:id/teams",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired geo resource (ex: 399 for Denver, 609 for Detroit)"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Events",
+ "methods":[
+ {
+ "MethodName":"events",
+ "Synopsis":"This collection method returns a list of event ids and names, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/:id",
+ "Synopsis":"Returns detailed information about a single event member including scores, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired event"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/:id/boxscore",
+ "Synopsis":"Returns a complete boxscore for a single event member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/:id/boxscore",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired event"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/:id/recap",
+ "Synopsis":"Returns a complete recap for a single event member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/:id/recap",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired event"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/today",
+ "Synopsis":"This collection action returns a list of event ids and names for events currently in progress, about to start, or just ended, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/today",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/next",
+ "Synopsis":"This collection action returns a list of event ids and names for the next two weeks of scheduled events, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/next",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/last",
+ "Synopsis":"This collection action returns a list of event ids and names for the last two weeks of scheduled events, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/last",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"events/:season_type",
+ "Synopsis":"This collection action returns a list of event ids and names for an entire season, preseason, or postseason, specified by the parent_resource and resource_id parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/events/:season_type",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ },
+ {
+ "Name":"season_type",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "season",
+ "presearch",
+ "postseason"
+ ],
+ "Description":"Season type"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Content",
+ "methods":[
+ {
+ "MethodName":"content",
+ "Synopsis":"This collection method returns a list of all content ids and titles, specified by the parent_resource and resource_id parameters belows.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/content",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "persons",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"content/:id",
+ "Synopsis":"Returns detailed information about a single content item, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/content/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the content resource."
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "persons",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"content/:filter",
+ "Synopsis":"This collection action returns a subset of all content ids and titles, specified by the filter parameter below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/content/:filter",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "persons"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ },
+ {
+ "Name":"filter",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "news",
+ "blog",
+ "columnists",
+ "video",
+ "fantasy",
+ "recruiting"
+ ],
+ "Description":"Filter to apply."
+ }
+ ]
+ },
+ {
+ "MethodName":"content/:id/related",
+ "Synopsis":"This action returns a set of related information for a single content member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/content/:id/related",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the content resource."
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "persons"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Images",
+ "methods":[
+ {
+ "MethodName":"images",
+ "Synopsis":"This collection method returns a list of image ids and descriptions, specified by the parent_resource and resource_id parameters belows.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/images",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "teams",
+ "persons",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ },
+ {
+ "MethodName":"images/:id",
+ "Synopsis":"Returns detailed information about a single image member, specified by the parameters below.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/images/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the image resource."
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "leagues",
+ "teams",
+ "persons",
+ "geo"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+ "Required":"N",
+ "Default":"",
+ "Type":"string",
+ "Description":"UUID of the desired parent_resource"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name":"Sources",
+ "methods":[
+ {
+ "MethodName":"sources",
+ "Synopsis":"This collection method returns a list of content source ids and names for all sources in the system, or a subset specified by a parent_resource.",
+ "HTTPMethod":"GET",
+ "URI":"/:tier/api/:parent_resource/:resource_id/sources",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"tier",
+ "Required":"Y",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "basic",
+ "silver",
+ "gold",
+ "platinum",
+ "unlimited"
+ ],
+ "Description":"API subscription tier"
+ },
+ {
+ "Name":"parent_resource",
+ "Required":"N",
+ "Default":"",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "",
+ "leagues",
+ "conferences",
+ "divisions",
+ "teams",
+ "persons"
+ ],
+ "Description":"Actual parent resource name"
+ },
+ {
+ "Name":"resource_id",
+