public ActionResult Sample01() { // Check is data posted if (Request.HttpMethod == "POST") { //### Set variables and get POST data System.Collections.Hashtable result = new System.Collections.Hashtable(); String clientId = Request.Form["clientId"]; String privateKey = Request.Form["privateKey"]; result.Add("clientId", clientId); result.Add("privateKey", privateKey); Groupdocs.Api.Contract.UserInfoResult userInfo = null; String message = null; // Check is all needed fields are entered if (clientId == null || privateKey == null) { //If not all fields entered send error message message = "Please enter all parameters"; result.Add("error", message); // Transfer error message to template return View("Sample01", null, result); } else { String basePath = Request.Form["basePath"]; //Check is base path entered if (basePath.Equals("")) { //If base path empty set base path to the dev server basePath = "https://api.groupdocs.com/v2.0"; } result.Add("basePath", basePath); // Create service for Groupdocs account GroupdocsService service = new GroupdocsService(basePath, clientId, privateKey); // Get info about user account userInfo = service.GetUserProfile(); //### Put user info to Hashtable result.Add("FirstName", userInfo.User.FirstName); result.Add("LastName", userInfo.User.LastName); result.Add("NickName", userInfo.User.NickName); result.Add("PrimaryEmail", userInfo.User.PrimaryEmail); // Return Hashtable with results to the template return View("Sample01", null, result); } } // If data not posted return to template for filling of necessary fields else { return View("Sample01"); } }