Legacy Dev Forum Posts

 View Only

Sign Up

Adding multiple subscriptions at once

  • 1.  Adding multiple subscriptions at once

    Posted 06-05-2025 18:05

    matthew | 2017-09-08 03:00:54 UTC | #1

    Hi, the .net sdk only seems to allow 1 notification subscription at once using this method: PureCloudPlatform.Client.V2.Extensions.Notifications.AddSubscription(string topic, Type type);

    Is it possible to allow multiple subscriptions to be added ie. AddSubscriptions(List< String > topics, Type type)

    Because of the rate limit, it takes us too long to add all the subscriptions we want, and I know the backend endpoint (/api/v2/notifications/channels/{channelId}/subscriptions) supports adding multiple at once.

    thanks!


    tim.smith | 2017-09-08 16:10:40 UTC | #2

    Give this a try with v18.1.0+

    var subscriptions = new List<Tuple<string, Type>>();
    subscriptions.Add(new Tuple($"v2.users.{_me.Id}.presence", typeof(UserPresenceNotification)));
    subscriptions.Add(new Tuple($"v2.users.{_me.Id}.routingStatus", typeof(UserRoutingStatusNotification)));
    handler.AddSubscriptions(subscriptions);

    matthew | 2017-09-12 01:26:07 UTC | #3

    that looks great, will give it a try! thanks for adding this in.


    system | 2017-10-19 09:12:43 UTC | #5

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 1774