SOLVED

Refresh Card not working?

%3CLINGO-SUB%20id%3D%22lingo-sub-1131919%22%20slang%3D%22en-US%22%3ERefresh%20Card%20not%20working%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1131919%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20dotnet%20core%20web%20api%20that%20receives%20an%20action%20from%20an%20incoming%20web%20hook.%26nbsp%3B%20It%20is%20an%20HTTP%20Post%20action%20on%20the%20web%20api%20that%20does%20some%20work%20and%20I%20want%20to%20reply%20to%20the%20message%20card%20using%20the%20refresh%20card.%3C%2FP%3E%3CP%3E%5BHttpPost%5D%3CBR%20%2F%3Epublic%20async%20Task%3CACTIONRESULT%3E%20Post()%3CBR%20%2F%3E%7B%3C%2FACTIONRESULT%3E%3C%2FP%3E%3CP%3E%2F%2F%20do%20work%20here%2C%20validate%2C%20etc..%20perform%20action%3C%2FP%3E%3CP%3EResponse.ContentType%20%3D%20%22application%2Fjson%3B%20charset%3Dutf-8%22%3B%3CBR%20%2F%3EResponse.Headers.Add(%22CARD-ACTION-STATUS%22%2C%20%22Plan%20is%20being%20created.%22)%3B%3CBR%20%2F%3EResponse.Headers.Add(%22CARD-UPDATE-IN-BODY%22%2C%20%22true%22)%3B%3CBR%20%2F%3Ereturn%20Ok()%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3EWhen%20I%20do%20this%20on%20the%20controller%20action%2C%20the%20Teams%20message%20card%20from%20the%20incoming%20web%20hook%20reads%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFailed%20to%20send%3C%2FP%3E%3CP%3EPlan%20is%20being%20created.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20can%20tell%20Teams%20is%20getting%20the%20refresh%20data%20to%20update%20the%20card%20body%20but%20its%20not%20doing%20it%20and%20I%20cannot%20seem%20to%20figure%20out%20why.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1131919%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Ewebhook%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1133156%22%20slang%3D%22en-US%22%3ERe%3A%20Refresh%20Card%20not%20working%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1133156%22%20slang%3D%22en-US%22%3E%3CP%3EFixed%20this%20by%20posting%20a%20JSON%20card%20back%20with%20the%20refresh%20card%20headers.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I have a dotnet core web api that receives an action from an incoming web hook.  It is an HTTP Post action on the web api that does some work and I want to reply to the message card using the refresh card.

[HttpPost]
public async Task<ActionResult> Post()
{

// do work here, validate, etc.. perform action

Response.ContentType = "application/json; charset=utf-8";
Response.Headers.Add("CARD-ACTION-STATUS", "Plan is being created.");
Response.Headers.Add("CARD-UPDATE-IN-BODY", "true");
return Ok();

}

When I do this on the controller action, the Teams message card from the incoming web hook reads:

 

Failed to send

Plan is being created.

 

So I can tell Teams is getting the refresh data to update the card body but its not doing it and I cannot seem to figure out why.

1 Reply
Highlighted
Solution

Fixed this by posting a JSON card back with the refresh card headers.