DocuSign CSharp Docs
|
DocuSignClient is mainly responsible for facilitating HTTP calls to the DocuSign APIs. More...
Public Member Functions | |
virtual void | InterceptRequest (DocuSignRequest request) |
Allows for extending request processing for DocuSignClient generated code. More... | |
virtual void | InterceptResponse (DocuSignRequest request, DocuSignResponse response) |
Allows for extending response processing for DocuSignClient generated code. More... | |
DocuSignClient () | |
Initializes a new instance of DocuSignClient with default with default base path (https://www.docusign.net/restapi). More... | |
DocuSignClient (Configuration configuration) | |
Initializes a new instance of DocuSignClient using the provided configuration with the default base path (https://www.docusign.net/restapi). More... | |
DocuSignClient (String apiBase, IWebProxy proxy=null) | |
Initializes a new instance of DocuSignClient configured with the provided API base path and optional IWebProxy object More... | |
DocuSignClient (String apiBase, String oAuthBase, IWebProxy proxy=null) | |
Initializes a new instance of DocuSignClient with the provided API base path, OAuth base path, and optional IWebProxy object More... | |
DocuSignClient (string apiBase, HttpClient apiClient) | |
Initializes a new instance of DocuSignClient with the provided API base path and pre-configured HttpClient object More... | |
DocuSignClient (string apiBase, IHttpClient client) | |
Initializes a new instance of DocuSignClient with the provided API base path and pre-configured IHttpClient object More... | |
String | GetBasePath () |
DocuSignRequest | PrepareOAuthRequest (string oAuthBasePath, string path, HttpMethod method, List< KeyValuePair< string, string >> headerParams=null, List< KeyValuePair< string, string >> formParams=null) |
DocuSignRequest | PrepareRequest (string path, HttpMethod method, List< KeyValuePair< string, string >> queryParams=null, object postBody=null, List< KeyValuePair< string, string >> headerParams=null, List< KeyValuePair< string, string >> formParams=null, List< KeyValuePair< string, string >> pathParams=null, List< FileParameter > fileParams=null, string contentType=null, string contentDisposition=null) |
DocuSignResponse | CallApi (DocuSignRequest request) |
async Task< DocuSignResponse > | CallApiAsync (DocuSignRequest request) |
string | EscapeString (string str) |
Escape string (url-encoded). More... | |
FileParameter | ParameterToFile (string name, Stream stream) |
Create FileParameter based on Stream. More... | |
string | ParameterToString (object obj) |
If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. If parameter is a list, join the list with ",". Otherwise just return the string. More... | |
object | Deserialize (DocuSignResponse response, Type type) |
Deserialize the JSON string into a proper object. More... | |
String | Serialize (object obj, string contentType="application/json") |
Serialize an input (model) into JSON string More... | |
String | SelectHeaderContentType (String[] contentTypes) |
Select the Content-Type header's value from the given content-type array: if JSON exists in the given array, use it; otherwise use the first one defined in 'consumes' More... | |
String | SelectHeaderAccept (String[] accepts) |
Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string) More... | |
Uri | GetAuthorizationUri (string clientId, List< string > scopes, string redirectUri, string responseType, string state=null) |
Helper method to configure the OAuth accessCode/implicit flow parameters More... | |
void | SetBasePath (string basePath) |
Use this method to Set Base Path More... | |
void | SetOAuthBasePath (string oauthBaseUri=null) |
Use this method to set custom OAuth Base Path. More... | |
OAuth.OAuthToken | GenerateAccessToken (string clientId, string clientSecret, string code) |
GenerateAccessToken will exchange the authorization code for an access token and refresh tokens. More... | |
OAuth.UserInfo | GetUserInfo (string accessToken) |
Get User Info method takes the accessToken to retrieve User Account Data. More... | |
OAuth.OAuthToken | RequestJWTUserToken (string clientId, string userId, string oauthBasePath, Stream privateKeyStream, int expiresInHours, List< string > scopes=null) |
Request JWT User Token Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign More... | |
OAuth.OAuthToken | RequestJWTUserToken (string clientId, string userId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List< string > scopes=null) |
Request JWT User Token Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign More... | |
OAuth.OAuthToken | RequestJWTApplicationToken (string clientId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List< string > scopes=null) |
RESERVED FOR PARTNERS Request JWT Application Token More... | |
Static Public Member Functions | |
static String | SerializeCsvToString (object obj) |
SerializeCsvToString - Interim method to Serialize the Request Object to CSV format More... | |
static String | SerializeCsvToString< T > (List< T > obj) |
SerializeCsvToString - Interim method to Serialize the Request Object to CSV format More... | |
static string | Base64Encode (string text) |
Encode string in base64 format. More... | |
static dynamic | ConvertType (dynamic source, Type dest) |
Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast More... | |
static byte [] | ReadAsBytes (Stream input) |
Convert stream to byte array Credit/Ref: http://stackoverflow.com/a/221941/677735 More... | |
static string | UrlEncode (string input) |
URL encode a string Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 More... | |
static string | SanitizeFilename (string filename) |
Sanitize filename by removing the path More... | |
Protected Member Functions | |
string | BuildQueryString (string clientId, string scopes, string redirectUri, string responseType, string state) |
Builds a QueryString with the given parameters More... | |
string | GetOAuthBasePath () |
GetOAuthBasePath sets the basePath for the user account. More... | |
Static Protected Member Functions | |
static IHttpClient | buildDefaultHttpClient (int timeout=Configuration.DefaultTimeoutValue, IWebProxy proxy=null) |
static RSA | CreateRSAKeyFromPem (string key) |
Creates an RSA Key from the given PEM key. More... | |
Properties | |
Configuration | Configuration [get, set] |
Gets or sets the Configuration. More... | |
IHttpClient | RestClient [get, set] |
Gets or sets the RestClient. More... | |
IWebProxy | Proxy .*[/\\](.*)$" [get, set] |
Gets or sets the Proxy of ApiClient. Default to null More... | |
DocuSignClient is mainly responsible for facilitating HTTP calls to the DocuSign APIs.
|
inline |
Initializes a new instance of DocuSignClient with default with default base path (https://www.docusign.net/restapi).
|
inline |
Initializes a new instance of DocuSignClient using the provided configuration with the default base path (https://www.docusign.net/restapi).
configuration | Provided pre-populated Configuration object |
|
inline |
Initializes a new instance of DocuSignClient configured with the provided API base path and optional IWebProxy object
apiBase | The API base path |
proxy | An optional IWebProxy instance |
ArgumentException | Thwon when apiBase is null or empty |
|
inline |
Initializes a new instance of DocuSignClient with the provided API base path, OAuth base path, and optional IWebProxy object
apiBase | The API base path |
oAuthBase | The oAuth base path |
proxy | An optional IWebProxy instance |
ArgumentException | Thrown when apiBase or oAuthBase are null or empty |
|
inline |
Initializes a new instance of DocuSignClient with the provided API base path and pre-configured HttpClient object
apiBase | The API base path |
apiClient | An instance of an HttpClient object |
|
inline |
Initializes a new instance of DocuSignClient with the provided API base path and pre-configured IHttpClient object
apiBase | |
client |
|
inlinestatic |
Encode string in base64 format.
text | String to be encoded. |
|
inlineprotected |
Builds a QueryString with the given parameters
clientId | |
scopes | |
redirectUri | |
responseType | |
state |
|
inlinestatic |
Dynamically cast the object into target type. Ref: http://stackoverflow.com/questions/4925718/c-dynamic-runtime-cast
source | Object to be casted |
dest | Target type |
|
inlinestaticprotected |
Creates an RSA Key from the given PEM key.
key |
|
inline |
Deserialize the JSON string into a proper object.
response | The HTTP response. |
type | Object type. |
|
inline |
Escape string (url-encoded).
str | String to be escaped. |
|
inline |
GenerateAccessToken will exchange the authorization code for an access token and refresh tokens.
clientId | OAuth2 client ID: Identifies the client making the request. |
clientSecret | the secret key you generated when you set up the integration in DocuSign Admin console. |
code | The authorization code that you received from the GetAuthorizationUri callback. |
|
inline |
Helper method to configure the OAuth accessCode/implicit flow parameters
clientId | OAuth2 client ID: Identifies the client making the request. |
scopes | the list of requested scopes. Client applications may be scoped to a limited set of system access. |
redirectUri | this determines where to deliver the response containing the authorization code or access token. |
responseType | determines the response type of the authorization request. Note: these response types are mutually exclusive for a client application. A public/native client application may only request a response type of "token"; a private/trusted client application may only request a response type of "code". |
state | Allows for arbitrary state that may be useful to your application. The value in this parameter will be round-tripped along with the response so you can make sure it didn't change. |
|
inlineprotected |
GetOAuthBasePath sets the basePath for the user account.
|
inline |
Get User Info method takes the accessToken to retrieve User Account Data.
accessToken |
|
inlinevirtual |
Allows for extending request processing for DocuSignClient generated code.
request | The IHttpClient request object |
|
inlinevirtual |
Allows for extending response processing for DocuSignClient generated code.
request | The DocuSignRequest request object |
response | The DocuSignResponse response object |
|
inline |
Create FileParameter based on Stream.
name | Parameter name. |
stream | Input stream. |
|
inline |
If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. If parameter is a list, join the list with ",". Otherwise just return the string.
obj | The parameter (header, path, query, form). |
|
inlinestatic |
Convert stream to byte array Credit/Ref: http://stackoverflow.com/a/221941/677735
input | Input stream to be converted |
|
inline |
RESERVED FOR PARTNERS Request JWT Application Token
clientId | DocuSign OAuth Client Id(AKA Integrator Key) |
oauthBasePath | DocuSign OAuth base path OAuth.Demo_OAuth_BasePath OAuth.Production_OAuth_BasePath OAuth.Stage_OAuth_BasePath |
privateKeyBytes | The byte contents of the RSA private key |
expiresInHours | Number of hours remaining before the JWT assertion is considered as invalid |
scopes | Optional. The list of requested scopes may include (but not limited to) You can also pass any advanced scope. OAuth.Scope_SIGNATURE OAuth.Scope_IMPERSONATION OAuth.Scope_EXTENDED |
|
inline |
Request JWT User Token Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
clientId | DocuSign OAuth Client Id(AKA Integrator Key) |
userId | DocuSign user Id to be impersonated(This is a UUID) |
oauthBasePath | DocuSign OAuth base path OAuth.Demo_OAuth_BasePath OAuth.Production_OAuth_BasePath OAuth.Stage_OAuth_BasePath |
privateKeyStream | The Stream of the RSA private key |
expiresInHours | Number of hours remaining before the JWT assertion is considered as invalid |
scopes | Optional. The list of requested scopes may include (but not limited to) OAuth.Scope_SIGNATURE OAuth.Scope_IMPERSONATION OAuth.Scope_EXTENDED |
|
inline |
Request JWT User Token Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
clientId | DocuSign OAuth Client Id(AKA Integrator Key) |
userId | DocuSign user Id to be impersonated(This is a UUID) |
oauthBasePath | DocuSign OAuth base path OAuth.Demo_OAuth_BasePath OAuth.Production_OAuth_BasePath OAuth.Stage_OAuth_BasePath |
privateKeyBytes | The byte contents of the RSA private key |
expiresInHours | Number of hours remaining before the JWT assertion is considered as invalid |
scopes | Optional. The list of requested scopes may include (but not limited to) You can also pass any advanced scope. OAuth.Scope_SIGNATURE OAuth.Scope_IMPERSONATION OAuth.Scope_EXTENDED |
|
inlinestatic |
Sanitize filename by removing the path
filename | Filename |
|
inline |
Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)
accepts | The accepts array to select from. |
|
inline |
Select the Content-Type header's value from the given content-type array: if JSON exists in the given array, use it; otherwise use the first one defined in 'consumes'
contentTypes | The Content-Type array to select from. |
|
inline |
Serialize an input (model) into JSON string
obj | Object. |
contentType |
|
inlinestatic |
SerializeCsvToString - Interim method to Serialize the Request Object to CSV format
obj |
|
inlinestatic |
SerializeCsvToString - Interim method to Serialize the Request Object to CSV format
T |
obj |
T | : | class |
|
inline |
Use this method to Set Base Path
basePath |
|
inline |
Use this method to set custom OAuth Base Path.
oauthBaseUri | Optional custom base path value. If not provided we will derive it according to the ApiClient basePath value. |
|
inlinestatic |
URL encode a string Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50
input | String to be URL encoded |
|
protected |
|
getset |
Gets or sets the Configuration.
An instance of the Configuration.
|
getset |
Gets or sets the Proxy of ApiClient. Default to null
Timeout.
|
getset |
Gets or sets the RestClient.
An instance of the RestClient