C# Class ExtApi.Engine.ApiRunner

Show file Open project: KallDrexx/ExtApi Class Usage Examples

Public Methods

Method Description
ExecuteApiCall ( string apiUrl, IList parameters, RequestMethod method, string username = "", string password = "" ) : ExtApi.Engine.Data.ExtApiCallResult

Performs an api call on the specified URL

ExecuteOAuthApiCall ( string apiUrl, IList parameters, RequestMethod method, string consumerKey, string consumerSecret, string accessToken, string tokenSecret ) : ExtApi.Engine.Data.ExtApiCallResult

Performs an OAuthed api call with the specified access token

Protected Methods

Method Description
BuildGetUrl ( string apiUrl, IList parameters ) : string

Builds a GET URL based on the specified api URL and the passed in parameters

ConvertRequestMethod ( RequestMethod method ) : Method
CreateExtApiCallResult ( RestResponse response ) : ExtApi.Engine.Data.ExtApiCallResult
HandleWebException ( WebException ex ) : ExtApi.Engine.Data.ExtApiCallResult

Method Details

BuildGetUrl() protected method

Builds a GET URL based on the specified api URL and the passed in parameters
protected BuildGetUrl ( string apiUrl, IList parameters ) : string
apiUrl string
parameters IList
return string

ConvertRequestMethod() protected method

protected ConvertRequestMethod ( RequestMethod method ) : Method
method RequestMethod
return Method

CreateExtApiCallResult() protected method

protected CreateExtApiCallResult ( RestResponse response ) : ExtApi.Engine.Data.ExtApiCallResult
response RestSharp.RestResponse
return ExtApi.Engine.Data.ExtApiCallResult

ExecuteApiCall() public method

Performs an api call on the specified URL
public ExecuteApiCall ( string apiUrl, IList parameters, RequestMethod method, string username = "", string password = "" ) : ExtApi.Engine.Data.ExtApiCallResult
apiUrl string
parameters IList
method RequestMethod
username string
password string
return ExtApi.Engine.Data.ExtApiCallResult

ExecuteOAuthApiCall() public method

Performs an OAuthed api call with the specified access token
Thrown when no token manager has been specified
public ExecuteOAuthApiCall ( string apiUrl, IList parameters, RequestMethod method, string consumerKey, string consumerSecret, string accessToken, string tokenSecret ) : ExtApi.Engine.Data.ExtApiCallResult
apiUrl string
parameters IList
method RequestMethod
consumerKey string
consumerSecret string
accessToken string
tokenSecret string
return ExtApi.Engine.Data.ExtApiCallResult

HandleWebException() protected method

protected HandleWebException ( WebException ex ) : ExtApi.Engine.Data.ExtApiCallResult
ex System.Net.WebException
return ExtApi.Engine.Data.ExtApiCallResult