Sage CRM 2021 R1: RESTful API Expansion - Retrieving Notification messages and user favourite data

1 minute read time.

Sage CRM 2021 R1 has provided support for a RESTful endpoint that will provide a developer with actions for about notifications directed at user. These are notifications that would appear within the Sage CRM user interface.

The Sage CRM UserData endpoint can be passed an Action.

UserData Actions

  • getNotifications
  • getNotificationOptions

getNotifications

http://{{server}}/sdata/{{install}}j/userdata?Action=getNotifications&SID={{sid}}

The Response is a JSON object that describes the current notification alerts for the user. These are the alerts that would be shown in the Top Bar of the main user interface.
https://help.sagecrm.com/on_premise/en/2021R1/main%20menu/Content/User/GS_UsingTopBar.htm 

Example Return

{
   "count":2,
   "notificationItems":[
      {
         "description":"High Value Opportunity created: Opportunity 100 User licenses with a forecast value of 209,872.00 assigned to Susan Maye has been created.",
         "action":null,
         "recordId":3,
         "ruleId":10167,
         "notifyColumnName":"Escl_DateTime",
         "entityId":10,
         "url":"/crm/eware.dll/Do?Act=260&SID=52051056526757&CLk=T&ErgTheme=0&Key7=3&Oppo_OpportunityId=3",
         "errorGroupUrl":null,
         "iconPath":"/crm/Themes/Img/ergonomic/Icons/Opportunity.png",
         "itemDate":1600676811000,
         "errorItem":false,
         "notificationItemType":"RECORD"
      },
      {
         "description":"High Value Opportunity won: Opportunity 85 User Licenses (time mgr) assigned to John Finch forecast value 200,000.00 has been won.",
         "action":null,
         "recordId":64,
         "ruleId":10168,
         "notifyColumnName":"Escl_DateTime",
         "entityId":10,
         "url":"/crm/eware.dll/Do?Act=260&SID=52051056526757&CLk=T&ErgTheme=0&Key7=64&Oppo_OpportunityId=64",
         "errorGroupUrl":null,
         "iconPath":"/crm/Themes/Img/ergonomic/Icons/Opportunity.png",
         "itemDate":1600676811000,
         "errorItem":false,
         "notificationItemType":"RECORD"
      }
   ],
   "displayCountExceeded":false
}

getNotificationOptions

http://{{server}}/sdata/{{install}}j/userdata?Action=getNotificationOptions&SID={{sid}}

The Response is a JSON object that provides the translations for the notification captions used in the main user interface. These appropriate for the user making the request.(e.g French, German, US English). This information is drawn from the Custom Captions table within metadata. This is described in the System Administration Guide: https://help.sagecrm.com/on_premise/en/2021R1/administration/Content/Administrator/TR_TransListMethod.htm 

Example Return US English user

{
   "Notifications":"Notifications",
   "Snooze":"Snooze",
   "Dismiss":"Dismiss",
   "Delete":"Delete",
   "SnoozeForAll":"Snooze all",
   "CloseAll":"Dismiss all",
   "DefaultOpen":"Default open",
   "DefaultClose":"Default closed",
   "NoneToDisplay":"None to display",
   "notificationtimeout":"There are too many notifications. Please dismiss some to see the rest.",
   "notificationDeltaItems":[
      {
         "caption":"5 minutes",
         "value":"5"
      },
      {
         "caption":"10 minutes",
         "value":"10"
      },
      {
         "caption":"15 minutes",
         "value":"15"
      },
      {
         "caption":"30 minutes",
         "value":"30"
      },
      {
         "caption":"1 hour",
         "value":"60"
      },
      {
         "caption":"2 hours",
         "value":"120"
      },
      {
         "caption":"3 hours",
         "value":"180"
      },
      {
         "caption":"4 hours",
         "value":"240"
      },
      {
         "caption":"5 hours",
         "value":"300"
      },
      {
         "caption":"6 hours",
         "value":"360"
      },
      {
         "caption":"7 hours",
         "value":"420"
      },
      {
         "caption":"8 hours",
         "value":"480"
      },
      {
         "caption":"1 day",
         "value":"1440"
      },
      {
         "caption":"2 days",
         "value":"2880"
      },
      {
         "caption":"3 days",
         "value":"4320"
      },
      {
         "caption":"4 days",
         "value":"5760"
      },
      {
         "caption":"5 days",
         "value":"7200"
      },
      {
         "caption":"1 week",
         "value":"10080"
      },
      {
         "caption":"2 weeks",
         "value":"20160"
      }
   ]
}