static void Main(string[] args) { Console.ReadLine(); string UserName() { Console.WriteLine("Username:"******"Password:"******"New comment:"); contact.Info.DefaultPhone.Description = Console.ReadLine(); if(contact.Info.DefaultPhone.Description == new UniEconomyAPIRequest(accessTokens).Modules.Contacts.Update(contact).Info.DefaultPhone.Description) { Console.WriteLine("DAMN BOY!"); } Console.WriteLine("Lager ny kontakt..."); UniModules.Contact contact1 = new UniModules.Contact(); contact1.Info.Name = "Andreas Ekeland"; contact1.Role = "Nyansatt"; UniModules.Contact contact1_svar = new UniEconomyAPIRequest(accessTokens).Modules.Contacts.New(contact1); Console.WriteLine(contact1_svar.Role + " - " + contact1_svar.Info.Name); Console.WriteLine("Vil du slette kontakten? Om ja skriv OK"); if(Console.ReadLine() == "OK") { if(new UniEconomyAPIRequest(accessTokens).Modules.Contacts.Delete(contact1_svar.ID) is true) { Console.WriteLine("Konten er slettet!"); } } Console.Read(); Console.Read(); }
//UPDATES CONTACT, THEN RETURN WHEN UPDATED IN DATABASE public UniModules.Contact Update(UniModules.Contact Arg_NewContact) { return(JsonConvert.DeserializeObject <UniModules.Contact>(handler.PUT("https://test-api.unieconomy.no/api/biz/contacts/" + Arg_NewContact.ID, Arg_NewContact))); }