public void Add()
        {
            Administrator administrator = new Administrator();

            try
            {
                 AdministratorDetails administratorDetails = new AdministratorDetails
                                {
                                    EmailAddress = "*****@*****.**",
                                    Name = "test",
                                };

                administrator.Add(administratorDetails);
            }
            catch (CreatesendException ex)
            {
                ErrorResult error = (ErrorResult)ex.Data["ErrorResult"];
                Console.WriteLine(error.Code);
                Console.WriteLine(error.Message);
            }
            catch (Exception ex)
            {
                //handle some other failure
            }
        }
 public string Update(string emailAddress, AdministratorDetails admin)
 {
     return(HttpPut <AdministratorDetails, AdministratorResult>(
                AdminsUrl, new NameValueCollection {
         { "email", emailAddress }
     },
                admin).EmailAddress);
 }
 public string Update(string emailAddress, AdministratorDetails admin)
 {
     return
         HttpHelper.Put<AdministratorDetails, AdministratorResult>(AuthCredentials, AdminsUrl, new NameValueCollection {{"email", emailAddress}},
                                                     admin).EmailAddress;
 }
 public string Add(AdministratorDetails admin)
 {
     return HttpHelper.Post<AdministratorDetails, AdministratorResult>(AuthCredentials, AdminsUrl, null, admin).EmailAddress;
 }
 public string Add(AdministratorDetails admin)
 {
     return(HttpPost <AdministratorDetails, AdministratorResult>(
                AdminsUrl, null, admin).EmailAddress);
 }