Forum Discussion

ssj_springctin's avatar
ssj_springctin
Copper Contributor
Nov 03, 2023

Activity Feed Notifications Fail Due to WebUrl Length Limit

Hello,  I'm using the sendActivityNotification Graph API to send Activity Feed Notifications to Teams users. I'm using a custom topic and systemDefault activity type. The webUrl is a deep link to my...
  • SaiPratap-MSFT's avatar
    Nov 09, 2023

    ssj_springctin  - 

    The documentation does not provide a specific limit for the length of the webUrl used in the sendActivityNotification Graph API. However, it's important to note that URLs in general have a length limit. Most web browsers can handle URLs up to 2048 characters, but some systems and servers have lower limits.
    If you're encountering issues with larger payloads, it might be due to exceeding these general URL length limits. You may need to consider reducing the size of your payload or using a different method to pass the data to your Teams Personal Tab app.

    If the payload is essential and cannot be reduced,

    you could follow this :

    Shorten the URL: You could use a URL shortening service to reduce the length of your webUrl. This would allow you to include larger payloads without hitting the character limit.

    Store the Payload Elsewhere: Instead of including the entire payload in the webUrl, you could store the payload data on a server and include a unique identifier in the webUrl. When the user opens the link, your app could use this identifier to retrieve the payload data from the server.

    Reduce the Payload Size: If possible, you could try to reduce the size of your payload. This could involve removing unnecessary data, using shorter keys, or compressing the data.

Resources