ms teams power automate HTTP POST sending "attachment id"

%3CLINGO-SUB%20id%3D%22lingo-sub-2818966%22%20slang%3D%22en-US%22%3Ems%20teams%20power%20automate%20HTTP%20POST%20sending%20%22attachment%20id%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2818966%22%20slang%3D%22en-US%22%3E%3CP%3Ebelow%20is%20the%20scenario%20i%20am%20trying%3A%3A%3C%2FP%3E%3CUL%3E%3CLI%3Ea%20payload%20is%20sent%20to%20MS%20teams%20channel%20using%20webhook%3C%2FLI%3E%3CLI%3Eusing%20the%20selected%20message%20in%20the%20channel%2C%20we%20trigger%20%22power%20automate%22%20flow%3C%2FLI%3E%3CLI%3Ethis%20flow%20will%20perform%20HTTP%20Post%20on%20the%20selected%20message%20using%20REST%20API%20POST%20with%20selected%20message%20as%20body.%3C%2FLI%3E%3CLI%3Ewe%20notice%20that%20the%20payload%20received%20in%20the%20target%20host%20is%20not%20expected%20as%20per%20what%20is%20selected%20message%2C%20for%20instance%2C%20payload%20contains%20like%20this%20that%20is%20received%20in%20target%20host%3A%3C%2FLI%3E%3C%2FUL%3E%3CBLOCKQUOTE%3E%3CP%3E%7B%22teamsFlowRunContext%22%3A%7B%22MessagePayload%22%3A%7B%22Id%22%3A%221633540811919%22%2C%22From%22%3A%7B%22Application%22%3A%7B%22DisplayName%22%3A%22alerts-test-hk-webhook%22%2C%22Id%22%3A%22gmbs42a62l%22%7D%2C%22Conversation%22%3Anull%2C%22Device%22%3Anull%2C%22User%22%3Anull%7D%2C%22Body%22%3A%7B%22ContentType%22%3A%22html%22%2C%22Content%22%3A%22%3CATTACHMENT%20id%3D%22%26quot%3B806b91eb802b49db9c13e8903de936f6%26quot%3B%22%3E%22%2C%22PlainText%22%3Anull%7D%2C%22Subject%22%3A%22%22%2C%22LinkToMessage%22%3A%22%3CA%20href%3D%22https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmessage%2F19%3A5463456345346ghdh%40thread.skype%2F1633540811919%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fteams.microsoft.com%2Fl%2Fmessage%2F19%3A5463456345346ghdh%40thread.skype%2F1633540811919%3C%2FA%3E%22%7D%2C%22Id%22%3A%22f%3A4abaa1b5-eb58-b8c7-5190-db70a3b28143%22%2C%22ChannelData%22%3A%7B%22EventType%22%3Anull%2C%22InvalidateInvokeCache%22%3Anull%2C%22Team%22%3A%7B%22Id%22%3A%2219%3Asdrg4wt45gsrth4y4her%40thread.skype%22%2C%22AadGroupId%22%3A%22b948e56e-4ea4-456f-bff4-16108061827f%22%2C%22Name%22%3Anull%7D%2C%22Tenant%22%3A%7B%22Id%22%3A%228bcff170-9979-491e-8683-d8ced0850bad%22%7D%2C%22Channel%22%3A%7B%22Id%22%3A%2219%3Af1b77b6a406d4f8ebfc33faefea1cf1a%40thread.skype%22%2C%22Name%22%3Anull%7D%2C%22Notification%22%3Anull%2C%22OnBehalfOf%22%3Anull%7D%2C%22From%22%3A%7B%22Id%22%3A%2229%3A1vERchnRGPZujmen29j4aZQzb2OFhXvipxhkjd3z7LyDleTr9PWVn-OBk1mxLcVl6ejhk9kvdw4L1Ph6FFoY5VA%22%2C%22Name%22%3A%22testuser%22%2C%22Role%22%3Anull%2C%22AadObjectId%22%3A%22cf1a646f-7a9b-4e33-830c-2bd0282a93fe%22%2C%22Properties%22%3Anull%7D%2C%22Conversation%22%3A%7B%22Id%22%3A%2219%3Af1b77b6a406d4f8ebfc33faefea1cf1a%40thread.skype%3Bmessageid%3D1633540811919%22%2C%22Name%22%3A%22buildeng-alerts-test-hk%22%2C%22IsGroup%22%3Atrue%7D%2C%22Locale%22%3A%22en-GB%22%2C%22CommandContext%22%3A%22message%22%2C%22LocalTimezone%22%3A%22India%20Standard%20Time%22%7D%2C%22cardOutputs%22%3A%7B%22choice%22%3A%22Retry%22%7D%7D%7D%3C%2FATTACHMENT%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EHowever%2C%20without%20using%20webhook%2C%20i.e%20manually%20typed%20or%20copy%2Fpaste%20in%20MS%20teams%20channel%2C%20and%20using%20the%20manually%20typed%20information%20or%20copy%2Fpaste%2C%20using%20the%20selected%20message%20in%20channel%2C%20triggered%20power%20automate%20flow%2C%20the%20payload%20is%20being%20correctly%20sent%20(as%20expected)%20like%20below%20payload%20received%20in%20target%20host%20%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%7B%22entity%22%3A%7B%22teamsFlowRunContext%22%3A%7B%22MessagePayload%22%3A%7B%22Id%22%3A%221633540339359%22%2C%22From%22%3A%7B%22Application%22%3Anull%2C%22Conversation%22%3Anull%2C%22Device%22%3Anull%2C%22User%22%3A%7B%22DisplayName%22%3A%22testuser%22%2C%22Id%22%3A%22cf1a646f-7a9b-4e33-830c-2bd0282a93fe%22%7D%7D%2C%22Body%22%3A%7B%22ContentType%22%3A%22html%22%2C%22Content%22%3A%22%5Cn%3C%2FP%3E%3CDIV%20itemprop%3D%22%26quot%3Bcopy-paste-block%26quot%3B%22%3E%5Cn%5Cn%3CDIV%20style%3D%22%26quot%3Bfont-size%3A12px%26quot%3B%22%3EBuild%20%3CA%20href%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2Fconsole%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2Fconsole%3C%2FA%3E%22%20rel%3D%22noreferrer%20noopener%22%20target%3D%22_blank%22%20title%3D%22%3CA%20href%3D%22https%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2Fconsole%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2Fconsole%3C%2FA%3E%22%26gt%3B(47)%20of%20%3CA%20href%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%2Fjob%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2F%3C%2FA%3E%22%20rel%3D%22noreferrer%20noopener%22%20target%3D%22_blank%22%20title%3D%22%3CA%20href%3D%22https%3A%2F%2Fexample.com%2F%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%2F%2Fhk-test%2Fjob%2Fhk-inifniteloop%2F47%2F%3C%2FA%3E%22%26gt%3B(hk-test%2Fhk-inifniteloop%2F47)%20failed%20on%20%3CA%20href%3D%22%26quot%3B%26lt%3BA%22%20href%3D%22https%3A%2F%2Fexample.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%3C%2FA%3E%22%20rel%3D%22noreferrer%20noopener%22%20target%3D%22_blank%22%20title%3D%22%3CA%20href%3D%22https%3A%2F%2Fexample.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fexample.com%2F%3C%2FA%3E%22%26gt%3B(example.com)%5Cn%5Cn%22%2C%22PlainText%22%3A%22%5Cn%5Cn%5CnBuild%20(47)%20of%20(%2Fhk-test%2Fhk-inifniteloop%2F47)%20failed%20on%20(teams-buildeng)%22%7D%2C%22Subject%22%3A%22%22%2C%22LinkToMessage%22%3A%22%3CA%20href%3D%22https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmessage%2F19%3A89nsad08dnd98fmhb-9dfijb%40thread.skype%2F1633540339359%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fteams.microsoft.com%2Fl%2Fmessage%2F19%3A89nsad08dnd98fmhb-9dfijb%40thread.skype%2F1633540339359%3C%2FA%3E%22%7D%2C%22Id%22%3A%22f%3Ab2ad833d-b218-a077-de38-c89ef8563ab6%22%2C%22ChannelData%22%3A%7B%22EventType%22%3Anull%2C%22InvalidateInvokeCache%22%3Anull%2C%22Team%22%3A%7B%22Id%22%3A%2219%3Af5f62v456v54b%40thread.skype%22%2C%22AadGroupId%22%3A%22b948e56e-4ea4-456f-bff4-16108061827f%22%2C%22Name%22%3Anull%7D%2C%22Tenant%22%3A%7B%22Id%22%3A%228bcff170-9979-491e-8683-d8ced0850bad%22%7D%2C%22Channel%22%3A%7B%22Id%22%3A%2219%3Af5v2356264%40thread.skype%22%2C%22Name%22%3Anull%7D%2C%22Notification%22%3Anull%2C%22OnBehalfOf%22%3Anull%7D%2C%22From%22%3A%7B%22Id%22%3A%2229%3Af4vw6vb65r6-OBk1mxLcVl6ejhk9kvdw4L1Ph6FFoY5VA%22%2C%22Name%22%3A%22testuser%22%2C%22Role%22%3Anull%2C%22AadObjectId%22%3A%22cf1a646f-7a9b-4e33-830c-2bd0282a93fe%22%2C%22Properties%22%3Anull%7D%2C%22Conversation%22%3A%7B%22Id%22%3A%2219%3A3425v2345bv45v45b%40thread.skype%3Bmessageid%3D1633540339359%22%2C%22Name%22%3A%22buildeng-alerts-test-hk%22%2C%22IsGroup%22%3Atrue%7D%2C%22Locale%22%3A%22en-GB%22%2C%22CommandContext%22%3A%22message%22%2C%22LocalTimezone%22%3A%22India%20Standard%20Time%22%7D%2C%22cardOutputs%22%3A%7B%22choice%22%3A%22Retry%22%7D%7D%7D%3CP%3E%3C%2FP%3E%3CP%3EPlease%20advise%20what%20caused%20this%20%22attachment%20id%22%20behaviour%20as%20we%20are%20automating%20the%20flow%20from%20jenkins%20to%20ms%20teams%20to%20http%20post%20to%20target%20host.%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2818966%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBots%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

below is the scenario i am trying::

  • a payload is sent to MS teams channel using webhook
  • using the selected message in the channel, we trigger "power automate" flow
  • this flow will perform HTTP Post on the selected message using REST API POST with selected message as body.
  • we notice that the payload received in the target host is not expected as per what is selected message, for instance, payload contains like this that is received in target host:

{"teamsFlowRunContext":{"MessagePayload":{"Id":"1633540811919","From":{"Application":{"DisplayName":"alerts-test-hk-webhook","Id":"gmbs42a62l"},"Conversation":null,"Device":null,"User":null},"Body":{"ContentType":"html","Content":"<attachment id="806b91eb802b49db9c13e8903de936f6">","PlainText":null},"Subject":"","LinkToMessage":"https://teams.microsoft.com/l/message/19:5463456345346ghdh@thread.skype/1633540811919"},"Id":"f:4abaa1b5-eb58-b8c7-5190-db70a3b28143","ChannelData":{"EventType":null,"InvalidateInvokeCache":null,"Team":{"Id":"19:sdrg4wt45gsrth4y4her@thread.skype","AadGroupId":"b948e56e-4ea4-456f-bff4-16108061827f","Name":null},"Tenant":{"Id":"8bcff170-9979-491e-8683-d8ced0850bad"},"Channel":{"Id":"19:f1b77b6a406d4f8ebfc33faefea1cf1a@thread.skype","Name":null},"Notification":null,"OnBehalfOf":null},"From":{"Id":"29:1vERchnRGPZujmen29j4aZQzb2OFhXvipxhkjd3z7LyDleTr9PWVn-OBk1mxLcVl6ejhk9kvdw4L1Ph6FFoY5VA","Name":"testuser","Role":null,"AadObjectId":"cf1a646f-7a9b-4e33-830c-2bd0282a93fe","Properties":null},"Conversation":{"Id":"19:f1b77b6a406d4f8ebfc33faefea1cf1a@thread.skype;messageid=1633540811919","Name":"buildeng-alerts-test-hk","IsGroup":true},"Locale":"en-GB","CommandContext":"message","LocalTimezone":"India Standard Time"},"cardOutputs":{"choice":"Retry"}}}

However, without using webhook, i.e manually typed or copy/paste in MS teams channel, and using the manually typed information or copy/paste, using the selected message in channel, triggered power automate flow, the payload is being correctly sent (as expected) like below payload received in target host :

{"entity":{"teamsFlowRunContext":{"MessagePayload":{"Id":"1633540339359","From":{"Application":null,"Conversation":null,"Device":null,"User":{"DisplayName":"testuser","Id":"cf1a646f-7a9b-4e33-830c-2bd0282a93fe"}},"Body":{"ContentType":"html","Content":"\n<div itemprop="copy-paste-block">\n\n<div style="font-size:12px">Build <a href="https://example.com/job/hk-test/job/hk-inifniteloop/47/console" rel="noreferrer noopener" target="_blank" title="https://example.com/job/hk-test/job/hk-inifniteloop/47/console">(47) of <a href="https://example.com/job/hk-test/job/hk-inifniteloop/47/" rel="noreferrer noopener" target="_blank" title="https://example.com//hk-test/job/hk-inifniteloop/47/">(hk-test/hk-inifniteloop/47) failed on <a href="https://example.com" rel="noreferrer noopener" target="_blank" title="https://example.com/">(example.com)\n\n","PlainText":"\n\n\nBuild (47) of (/hk-test/hk-inifniteloop/47) failed on (teams-buildeng)"},"Subject":"","LinkToMessage":"https://teams.microsoft.com/l/message/19:89nsad08dnd98fmhb-9dfijb@thread.skype/1633540339359"},"Id":"f:b2ad833d-b218-a077-de38-c89ef8563ab6","ChannelData":{"EventType":null,"InvalidateInvokeCache":null,"Team":{"Id":"19:f5f62v456v54b@thread.skype","AadGroupId":"b948e56e-4ea4-456f-bff4-16108061827f","Name":null},"Tenant":{"Id":"8bcff170-9979-491e-8683-d8ced0850bad"},"Channel":{"Id":"19:f5v2356264@thread.skype","Name":null},"Notification":null,"OnBehalfOf":null},"From":{"Id":"29:f4vw6vb65r6-OBk1mxLcVl6ejhk9kvdw4L1Ph6FFoY5VA","Name":"testuser","Role":null,"AadObjectId":"cf1a646f-7a9b-4e33-830c-2bd0282a93fe","Properties":null},"Conversation":{"Id":"19:3425v2345bv45v45b@thread.skype;messageid=1633540339359","Name":"buildeng-alerts-test-hk","IsGroup":true},"Locale":"en-GB","CommandContext":"message","LocalTimezone":"India Standard Time"},"cardOutputs":{"choice":"Retry"}}}

Please advise what caused this "attachment id" behaviour as we are automating the flow from jenkins to ms teams to http post to target host.

0 Replies