Guest User

Untitled

a guest
Feb 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. // Lets just like a comment
  2. var ok = await client.Projects.Reactions.LikeItem("comment", "commentId");
  3.  
  4. // we can even send messages on teamwork chat!
  5. var ok = await client.Projects.Chat.SendMessage("the message i want to send", "the RoomId");
  6.  
  7. // Update your status
  8. var ok = await client.Projects.Me.AddNewStatusMessage("Gone Fishin");
  9.  
  10.  
  11. // Or a more complex example, create a company, add a person and
  12. // finaly create a project for the new company
  13.  
  14. // first add the company
  15. var company = new Company() {
  16. Name = "MyNewCompany"
  17. };
  18. var companyId = await client.Projects.Companies.AddCompany(company);
  19.  
  20. // Now add a person and assign it to the newly created company
  21. var newPerson = new Person() {
  22. EmailAddress = "max@teamwork.com",
  23. FirstName = "max",
  24. LastName = "miller",
  25. CompanyId = companyId
  26. };
  27. var ok = await client.Projects.People.AddPerson(newPerson);
  28.  
  29. // Finally add a project for the newly added company
  30. var projectToCreate = new Project() {
  31. Name = "My New project",
  32. CompanyId = companyid
  33. };
  34. var ok = await client.Projects.Projects.AddProject(projectToCreate);
Add Comment
Please, Sign In to add comment