Exemplo n.º 1
0
        /// <summary>
        /// Gets login information for a specified user. Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.  \n\nThe `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
        /// </summary>
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>7Task of LoginInformation</returns>
        public async System.Threading.Tasks.Task <LoginInformation> LoginAsync(AuthenticationApi.LoginOptions options = null)
        {
            ApiResponse <LoginInformation> response = await LoginAsyncWithHttpInfo(options);

            return(response.Data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets login information for a specified user. Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.  \n\nThe `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
        /// </summary>
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>8Task of ApiResponse (LoginInformation)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <LoginInformation> > LoginAsyncWithHttpInfo(AuthenticationApi.LoginOptions options = null)
        {
            var path_ = "/v2/login_information";

            var    pathParams   = new Dictionary <String, String>();
            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            Object postBody     = null;

            // to determine the Content-Type header
            String[] httpContentTypes = new String[] {
            };
            String httpContentType    = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes);

            // to determine the Accept header
            String[] httpHeaderAccepts = new String[] {
                "application/json"
            };
            String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts);

            if (httpHeaderAccept != null)
            {
                headerParams.Add("Accept", httpHeaderAccept);
            }

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            pathParams.Add("format", "json");



            if (options != null)
            {
                if (options.apiPassword != null)
                {
                    queryParams.Add("api_password", Configuration.ApiClient.ParameterToString(options.apiPassword));                                              // query parameter
                }
                if (options.includeAccountIdGuid != null)
                {
                    queryParams.Add("include_account_id_guid", Configuration.ApiClient.ParameterToString(options.includeAccountIdGuid));                                                       // query parameter
                }
                if (options.loginSettings != null)
                {
                    queryParams.Add("login_settings", Configuration.ApiClient.ParameterToString(options.loginSettings));                                                // query parameter
                }
            }



            // make the HTTP request
            IRestResponse response = (IRestResponse)await Configuration.ApiClient.CallApiAsync(path_,
                                                                                               Method.GET, queryParams, postBody, headerParams, formParams, fileParams,
                                                                                               pathParams, httpContentType);

            int statusCode = (int)response.StatusCode;

            if (statusCode >= 400)
            {
                throw new ApiException(statusCode, "Error calling Login: "******"Error calling Login: " + response.ErrorMessage, response.ErrorMessage);
            }

            return(new ApiResponse <LoginInformation>(statusCode,
                                                      response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                      (LoginInformation)Configuration.ApiClient.Deserialize(response, typeof(LoginInformation))));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets login information for a specified user. Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.  \n\nThe `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
        /// </summary>
        /// <param name="options">Options for modifying the behavior of the function.</param>
        /// <returns>5LoginInformation</returns>
        public LoginInformation Login(AuthenticationApi.LoginOptions options = null)
        {
            ApiResponse <LoginInformation> response = LoginWithHttpInfo(options);

            return(response.Data);
        }