コード例 #1
0
        /// <summary>
        /// Returns Account available seals for specified account.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <returns>Task of ApiResponse (AccountSeals)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <AccountSeals> > GetSealProvidersAsyncWithHttpInfo(string accountId)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
            {
                throw new ApiException(400, "Missing required parameter 'accountId' when calling TrustServiceProvidersApi->GetSealProviders");
            }

            var    localVarPath                   = "/v2.1/accounts/{accountId}/seals";
            var    localVarPathParams             = new Dictionary <String, String>();
            var    localVarQueryParams            = new Dictionary <String, String>();
            var    localVarHeaderParams           = new Dictionary <String, String>(this.ApiClient.Configuration.DefaultHeader);
            var    localVarFormParams             = new Dictionary <String, String>();
            var    localVarFileParams             = new List <FileParameter>();
            Object localVarPostBody               = null;
            String localVarHttpContentDisposition = string.Empty;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType    = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null)
            {
                localVarPathParams.Add("accountId", this.ApiClient.ParameterToString(accountId));                    // path parameter
            }
            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            DocuSignRequest  localVarRequest  = this.ApiClient.PrepareRequest(localVarPath, HttpMethod.Get, localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition);
            DocuSignResponse localVarResponse = await this.ApiClient.CallApiAsync(localVarRequest);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetSealProviders", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <AccountSeals>(localVarStatusCode,
                                                  localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
                                                  (AccountSeals)this.ApiClient.Deserialize(localVarResponse, typeof(AccountSeals))));
        }
コード例 #2
0
        /// <summary>
        /// Retrieves org level report by correlation id and site.
        /// </summary>
        /// <exception cref="DocuSign.eSign.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="organizationId"></param>
        /// <param name="reportCorrelationId"></param>
        /// <returns>ApiResponse of Object(void)</returns>
        public ApiResponse <Object> GetReportV2WithHttpInfo(string organizationId, string reportCorrelationId)
        {
            // verify the required parameter 'organizationId' is set
            if (organizationId == null)
            {
                throw new ApiException(400, "Missing required parameter 'organizationId' when calling OrganizationsApi->GetReportV2");
            }
            // verify the required parameter 'reportCorrelationId' is set
            if (reportCorrelationId == null)
            {
                throw new ApiException(400, "Missing required parameter 'reportCorrelationId' when calling OrganizationsApi->GetReportV2");
            }

            var    localVarPath                   = "/v2.1/organization_reporting/{organizationId}/reportsv2/{reportCorrelationId}";
            var    localVarPathParams             = new Dictionary <String, String>();
            var    localVarQueryParams            = new Dictionary <String, String>();
            var    localVarHeaderParams           = new Dictionary <String, String>(this.ApiClient.Configuration.DefaultHeader);
            var    localVarFormParams             = new Dictionary <String, String>();
            var    localVarFileParams             = new List <FileParameter>();
            Object localVarPostBody               = null;
            String localVarHttpContentDisposition = string.Empty;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType    = this.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (organizationId != null)
            {
                localVarPathParams.Add("organizationId", this.ApiClient.ParameterToString(organizationId));                         // path parameter
            }
            if (reportCorrelationId != null)
            {
                localVarPathParams.Add("reportCorrelationId", this.ApiClient.ParameterToString(reportCorrelationId));                              // path parameter
            }
            // authentication (docusignAccessCode) required
            // oauth required
            if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken))
            {
                localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken;
            }

            // make the HTTP request
            DocuSignRequest  localVarRequest  = this.ApiClient.PrepareRequest(localVarPath, HttpMethod.Get, localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition);
            DocuSignResponse localVarResponse = this.ApiClient.CallApi(localVarRequest);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetReportV2", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
                                            null));
        }