Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  SystemPresence Case

    Posted 06-05-2025 18:10

    skansakar | 2016-08-18 15:19:34 UTC | #1

    The systemPresence (e.g. Available/On Queue/Offline etc) on presenceDefinition has a different case compared to systemPresence returned on the notification message, when subscribed to "topicName":"v2.users.{id}.presence"?

    Is this a bug?


    tim.smith | 2016-08-18 15:58:52 UTC | #2

    The case of the string is unimportant; the best practice is to always use a case insensitive comparison.


    skansakar | 2016-08-18 16:09:14 UTC | #3

    Agreed but it would be good to be it consistent? :slight_smile:


    skansakar | 2016-08-19 09:15:54 UTC | #4

    @tim.smith actually case insensitive comparison does not work for all. It work for most as it is single word but for two work presence it does not. (e.g. presenceDefintion for On Queue has a value of "On Queue" however, the value on the notification message is "ON_QUEUE")

    I am creating a map from Get presence definition and using the name to compare.


    tim.smith | 2016-08-19 15:52:15 UTC | #5

    There does appear to be a discrepancy there. I've checked with the dev team, but this can't be changed without some significant breaking changes, which is a no-go without a major API revision (starting v3). This will be changed in the future, but not in v2.

    The best practice for handling presences is to key off of the presence ID, not the name. The display string should be retrieved from the presence's languageLabels property when retrieved from GET /api/v2/presencedefinitions. But note that the default presences only define en_US labels currently; the PureCloud client localizes them client side, as your application will need to do if you need any other locale. Custom presences can have any locales you specify when configuring them.


    system | 2017-08-28 19:26:32 UTC | #6


    This post was migrated from the old Developer Forum.

    ref: 305