question

Sebastian Stefaniuk avatar image
Sebastian Stefaniuk asked Sebastian Stefaniuk answered

How to post "code snippet" or file attachment in message via webhook?

I've been searching the docs and community for an answer to this without success. I'm thinking it must be somehow possible, and hoping someone here could provide an answer.

I am using webhooks to post messages from an AWS lambda, which works great! I would like to send a message that contains potentially long (up to 256kb) snippets of code. I was hoping I could do that as an attachment, but didn't see any way to do this via webhooks. Then I tried to find out if it was possible to send a truncated code snippet in the post (up to 10000 chars). By code snippet I don't mean "[code]...[/code]" but the actual "code snippet" functionality that displays a different card.

Is either attachment or code snippet at all possible via webhooks? If so, would I use the Adaptive Cards schema or the legacy schema?

Thanks everyone!

messagewebhooks
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

I don't fully understand your question. You wrote "I am using webhooks to post messages from an AWS lambda". Webhooks is for receiving inbound messages, what do you mean using it to post from?

Is your question related to RingCentral add-in Outbound Webhooks?

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Sebastian Stefaniuk avatar image
Sebastian Stefaniuk answered

It's just a simple POSTing a message to a webhook URL. I'm going off of this guide: https://developers.ringcentral.com/guide/team-messaging/incoming-webhooks/posting

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys