C# Class BotR.API.BotRAPI

Show file Open project: sol1/botr.NET Class Usage Examples

Public Methods

Method Description
BotRAPI ( string key, string secret ) : System
BotRAPI ( string url, string version, string key, string secret ) : System
Call ( string apiCall ) : string

Call the API method with no params beyond the required

Call ( string apiCall, NameValueCollection args ) : string

Call the API method with additional, non-required params

Upload ( string uploadUrl, NameValueCollection args, string filePath ) : string

Upload a file to account with optional arguments

Upload ( string uploadUrl, string filePath ) : string

Upload a file to account without optional arguments

Private Methods

Method Description
UrlEncodeUCase ( string data, Encoding enc ) : string

Convert hex chars to uppercase as per OAuth-spec requirement

buildArgs ( ) : void

Append required arguments to URL

createWebClient ( ) : WebClient

Construct instance of WebClient for request

getUnixTime ( ) : int

Get timestamp in Unix format

queryStringToArgs ( ) : void

Convert args collection to ordered string

signArgs ( ) : string

Hash the provided arguments

Method Details

BotRAPI() public method

public BotRAPI ( string key, string secret ) : System
key string
secret string
return System

BotRAPI() public method

public BotRAPI ( string url, string version, string key, string secret ) : System
url string
version string
key string
secret string
return System

Call() public method

Call the API method with no params beyond the required
public Call ( string apiCall ) : string
apiCall string The path to the API method call (/videos/list)
return string

Call() public method

Call the API method with additional, non-required params
public Call ( string apiCall, NameValueCollection args ) : string
apiCall string The path to the API method call (/videos/list)
args System.Collections.Specialized.NameValueCollection Additional, non-required arguments
return string

Upload() public method

Upload a file to account with optional arguments
public Upload ( string uploadUrl, NameValueCollection args, string filePath ) : string
uploadUrl string The url returned from /videos/create call
args System.Collections.Specialized.NameValueCollection Optional args (video meta data)
filePath string Path to file to upload
return string

Upload() public method

Upload a file to account without optional arguments
public Upload ( string uploadUrl, string filePath ) : string
uploadUrl string The url returned from /videos/create call
filePath string Path to file to upload
return string