问题
I have a Microsoft Flow which pulls a SharePoint List item and it's attachments, creates a message, then sends that message to Teams through a Webhook connector.
In order to send the attachments, I am required to send the Base64
representation. I believe this is making the message too large, as I am receiving HTTP 413
response.
The message I am sending is correct (I tested it in the Actionable Message playground), but it's the connection (HTTP POST to Teams) which is failing. Please help me understand what I can do to allow the large message to pass through.
Error message:
The HTTP Post returns 200
, but the body says:
Webhook message delivery failed with error: Microsoft Teams endpoint returned
HTTP error 413
withContextId tcid=2621360276746394848, server=EAP010230119133,cv=NwLUXyVdN0uhKCant2X4fw.0
JSON here: https://prod-27.westus.logic.azure.com/workflows/267e9bf8072f49c2bc5893e18713125e/runs/08586810469649730296076568902CU20/actions/Compose/contents/ActionOutputs?api-version=2017-07-01&se=2018-03-09T22%3A00%3A00.0000000Z&sp=%2Fruns%2F08586810469649730296076568902CU20%2Factions%2FCompose%2Fcontents%2FActionOutputs%2Fread&sv=1.0&sig=Qi0UCGvdzKUTtzd8uW27V1j0apMo--kyS5bVYUAmlME
回答1:
Solution was to put images in a Picture Library in Sharepoint. This folder is Public.
回答2:
Posting too large messages to the Teams webhook URL will issue the 413 HTTP status which means Payload Too Large. There is no official statement yet about the maximums regarding these payloads for the connector webhook.
I asked here this question regarding the message/payload sizes and some experimental results.
Regarding your specific questions, a small image is easily going over the 20KB. If you have to encode it further to Base64, the size will increase even more.
Hence for images, one should use links towards them.
来源:https://stackoverflow.com/questions/49199443/microsoft-flow-sharepoint-to-teams-http-413