3

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 with ContextId 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

chriscam85
  • 66
  • 1
  • 7
  • Is this a programming question or one to do with using Sharepoint? – tadman Mar 09 '18 at 17:51
  • It's has to do with Microsoft Flow and HTTP messaging – chriscam85 Mar 09 '18 at 17:52
  • I'm voting to close this question as off-topic because this is not a programming question. – tadman Mar 09 '18 at 17:52
  • You're going to need to include some code or this is off-topic. – tadman Mar 09 '18 at 17:52
  • Off topic? I want this posted in Microsoft teams section. Am I in the wrong place? – chriscam85 Mar 09 '18 at 17:54
  • There's no such section here. Stack Overflow tries to focus on programming problems as they pertain to code, so if you've got some code that's running in Sharepoint that's not working correctly, you're in the right place. Otherwise you'll need to find a Sharepoint support forum or channel. – tadman Mar 09 '18 at 17:55
  • It's not SharePoint per se. I'll get the code here, it's a JSON payload over HTTP – chriscam85 Mar 09 '18 at 17:55
  • When tagging, try and tag only the things that are immediately relevant to solving your problem. – tadman Mar 09 '18 at 17:58
  • 1
    Can you add the JSON you're using for the message? Also, is there a reason why you're POSTing the attachment rather than pulling it from SharePoint directly (from the Flow)? – Marc LaFleur Mar 09 '18 at 18:31
  • I posted a URL to the JSON message. Marc, you are the one who told me to pull the attachment, as Base64 to send it, so it is embedded in the message, since you mentioned SP shouldn't be used as a image hosting server. – chriscam85 Mar 09 '18 at 18:37
  • @chriscam85 I assume these are image attachments or you wouldn't be asking the question. But what kind of images are they? In particular are they https: images and are they externally accessible from the open internet, or do they reside behind your firewall? In general, more info on exactly what you are trying to do and how you are doing it would be helpful. – Bill Bliss - MSFT Mar 14 '18 at 09:22
  • @BillBliss-MSFT As far as I know, they should be accessible anywhere, being in the Public sharepoint folder. But I remember seeing something about Sharepoint turning off external visibility. Here's an example url of one of my images: https://cpqsolutions.sharepoint.com/Lists/Daily%20Knowledge/Attachments/54/ControlStepNotifications.png – chriscam85 Mar 18 '18 at 17:10

2 Answers2

1

Solution was to put images in a Picture Library in Sharepoint. This folder is Public.

chriscam85
  • 66
  • 1
  • 7
1

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.

Gabriel Petrovay
  • 20,476
  • 22
  • 97
  • 168