This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install-package Teamwork -IncludePrerelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Teamwork; | |
using Teamwork.Shared; | |
using Teamwork.Shared.Common; | |
private async Task<Teamwork.Client> HandleOauthAuthentication(string code, string state) | |
{ | |
var response = await LoginFlow.TeamworkLoginFlow.GetLoginDataAsync(code); | |
// Use response to initialize a new instance of the Teamwork APi Client | |
return Client.GetTeamworkClient( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get all people in installation | |
var people = client.Projects.People.GetPeopleAsync(); | |
// Get status updates by people in installation | |
var latestStatusMessages = client.Projects.People.GetPeopleStatusAsync(); | |
// Find a person by email | |
var personByMail = client.Projects.People.GetPersonByMailAsync("max@teamwork.com"); | |
// Get all active Projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new TodoItem instance | |
var newTask = new TodoItem() { | |
Description = "This is a new task we want to add", | |
Content = "The Title for my new task" | |
}; | |
// And add it as task to a project | |
// tasklist id can be left blank, the task will be added to an "Inbox" tasklist | |
// also we can add it as a subtask and assign the parenttask | |
var result = await client.Projects.Projects.AddTodoItem( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "AdaptiveCard", | |
"body": [ | |
{ | |
"type": "Container", | |
"items": [ | |
{ | |
"type": "ColumnSet", | |
"columns": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AdaptiveCards; | |
// ... | |
AdaptiveCard card = new AdaptiveCard(); | |
var container = new AdaptiveContainer(); | |
var column = new AdaptiveColumn(){Width=Auto}; | |
column.Items.Add(new AdaptiveImage( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an adaptive card and send it | |
var payload = await _cardservice.RenderCard(templateKey, template, data); | |
var result = await client.PostAsync(url, new StringContent(payload)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//the underlying CardRenderService | |
public class CardRenderService | |
{ | |
private RazorLightEngine Engine; | |
public CardRenderService() | |
{ | |
Engine = new RazorLightEngineBuilder().UseMemoryCachingProvider().Build(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if(Model.Task.TaskDueDate != null) | |
{ | |
<text>, | |
{ | |
"title": "Due Date", | |
"value": "@Model.Task.TaskDueDate.ToShortDateString()" | |
} | |
</text> | |
} |
OlderNewer