Skip to content

Instantly share code, notes, and snippets.

@DeeJayTC
Created February 15, 2019 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeeJayTC/509931b06ca8e2d4347ceb5428910594 to your computer and use it in GitHub Desktop.
Save DeeJayTC/509931b06ca8e2d4347ceb5428910594 to your computer and use it in GitHub Desktop.
// Lets just like a comment
var ok = await client.Projects.Reactions.LikeItem("comment", "commentId");
// we can even send messages on teamwork chat!
var ok = await client.Projects.Chat.SendMessage("the message i want to send", "the RoomId");
// Update your status
var ok = await client.Projects.Me.AddNewStatusMessage("Gone Fishin");
// Or a more complex example, create a company, add a person and
// finaly create a project for the new company
// first add the company
var company = new Company() {
Name = "MyNewCompany"
};
var companyId = await client.Projects.Companies.AddCompany(company);
// Now add a person and assign it to the newly created company
var newPerson = new Person() {
EmailAddress = "max@teamwork.com",
FirstName = "max",
LastName = "miller",
CompanyId = companyId
};
var ok = await client.Projects.People.AddPerson(newPerson);
// Finally add a project for the newly added company
var projectToCreate = new Project() {
Name = "My New project",
CompanyId = companyid
};
var ok = await client.Projects.Projects.AddProject(projectToCreate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment