Exemplo n.º 1
0
        public ActionResult RetriveProfileByEmail(string email)
        {
            try
            {
                Guid?  organizationId = RequestItemsService.OrganizationId;
                string accessToken    = RequestItemsService.User.AccessToken;
                string basePath       = RequestItemsService.Session.AdminApiBasePath;

                UsersDrilldownResponse profileWithSearchedEmail = RetrieveDocuSignProfileByEmailAddress.
                                                                  GetDocuSignProfileByEmailAdress(basePath, accessToken, organizationId, email);

                ViewBag.h1          = "Retrieve the user's DocuSign profile using an email address";
                ViewBag.message     = "Results from MultiProductUserManagement:getUserDSProfilesByEmail method:";
                ViewBag.Locals.Json = JsonConvert.SerializeObject(profileWithSearchedEmail, Formatting.Indented);

                return(View("example_done"));
            }
            catch (ApiException apiException)
            {
                ViewBag.errorCode    = apiException.ErrorCode;
                ViewBag.errorMessage = apiException.Message;

                return(View("Error"));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a DocuSign profile by the email adress
        /// </summary>
        /// <param name="basePath">BasePath for API calls (URI)</param>
        /// <param name="accessToken">Access Token for API call (OAuth)</param>
        /// <param name="orgId">DocuSign Organization Id (GUID)</param>
        /// <param name="email">Email adress (string)</param>
        /// <returns>DocuSign profile, that has the searched email</returns>
        public static UsersDrilldownResponse GetDocuSignProfileByEmailAdress(
            string basePath,
            string accessToken,
            Guid?orgId,
            string email)
        {
            // Step 2 start
            var apiClient = new ApiClient(basePath);

            apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken);
            // Step 2 end

            // Step 3 start
            var usersApi            = new UsersApi(apiClient);
            var retrieveUserOptions = new UsersApi.GetUserDSProfilesByEmailOptions
            {
                email = email
            };

            UsersDrilldownResponse userWithSearchedEmail = usersApi.GetUserDSProfilesByEmail(orgId, retrieveUserOptions);

            // Step 3 end

            return(userWithSearchedEmail);
        }