public ActionResult Create(CreateTicketViewModel model)
        {
            var zendesk = ConfigurationManager.AppSettings["ZendeskUrl"];
            var zendeskUser = ConfigurationManager.AppSettings["ZendeskUser"];
            var zendeskPassword = ConfigurationManager.AppSettings["ZendeskPassword"];

            //set up the api
            var api = new ZendeskApi(zendesk, zendeskUser, zendeskPassword);

            //create the user if they don't already exist
            var user = api.Users.SearchByEmail(model.RequesterEmail);
            if (user == null || user.Users.Count < 1)
                api.Users.CreateUser(new User()
                                         {
                                             Name = model.RequesterEmail,
                                             Email = model.RequesterEmail
                                         });

            //setup the ticket
            var ticket = new Ticket()
            {
                Subject = model.Subject,
                Description = model.Description,
                Priority = model.TicketPriority,
                Requester = new Requester() { Email = model.RequesterEmail }
            };

            //create the new ticket
            var res = api.Tickets.CreateTicket(ticket).Ticket;

            return View("Index", new CreateTicketViewModel() {TicketId = res.Id.ToString(), ZendeskUrl = zendesk});
        }
        public ActionResult Create(CreateTicketViewModel model)
        {
            var zendesk = "https://eswebtech.zendesk.com/";
            //set up the api
            var api = new ZendeskApi(string.Format("{0}api/v2", zendesk), "*****@*****.**", "pa55word");

            //create the user if they don't already exist
            var user = api.Users.SearchByEmail(model.RequesterEmail);
            if (user == null || user.Users.Count < 1)
                api.Users.CreateUser(new User()
                                         {
                                             Name = model.RequesterEmail,
                                             Email = model.RequesterEmail
                                         });

            //setup the ticket
            var ticket = new Ticket()
            {
                Subject = model.Subject,
                Description = model.Description,
                Priority = model.TicketPriority,
                Requester = new Requester() { Email = model.RequesterEmail }
            };

            //create the new ticket
            var res = api.Tickets.CreateTicket(ticket).Ticket;

            return View("Index", new CreateTicketViewModel() {TicketId = res.Id.ToString(), ZendeskUrl = zendesk});
        }