Sage CRM 2021 R1: RESTful API Expansion - Preferences and settings including the calendar information

1 minute read time.

Sage CRM 2021 R1 has provided support for a RESTful endpoint that will provide a developer with two actions for retrieving information about a user's preferences.

The Sage CRM UserData endpoint can be passed an Action.

UserData Actions

  • getCalendarUserPreferences
  • getCalendarTranslations

getCalendarUserPreferences

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

The Response is a JSON object that describes the user calendar preferences. See: https://help.sagecrm.com/on_premise/en/2021R1/main%20menu/Content/User/PR_Preferences-DateTime.htm 

Example Return

{
   "NSET_CALENDARVIEW":"workweek",
   "NSET_DIARYENDTIME":"17:30",
   "NSET_USERDATEFORMAT":"dd/MM/yyyy",
   "NSET_DIARYSTARTTIME":"08:00",
   "NSET_TIMEZONE":"Europe/London",
   "NSET_WEEKSTARTDAY":"2",
   "NSET_USERUSEAMPM":"N"
}

getCalendarTranslations

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

The Response is a JSON object that provides the translations for each of the calendar captions appropriate for that user (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

{
   "Add":"Add",
   "AddFileDragDrop":"Click to browse for files or drop files on icon",
   "AddingFiles":"Adding files",
   "All":"-All-",
   "Attachments":"Attachments",
   "Busy":"Busy",
   "CALENDAR_HELP":"http://help.sagecrm.com/on_premise/EN/2020R2/Main Menu/content/User/CL_UsingMyCrmCalendar.htm",
   "CannotAddBlankAppointment":"Please enter details of the appointment.",
   "CannotAddBlankTask":"Please enter details of the task.",
   "ClickAddBtnForAddingAppointment":"Quick Appointment",
   "ClickAddBtnForAddingTask":"Quick Task",
   "Close":"Close",
   "Cmli_Comm_CompanyId":"Company",
   "Cmli_Comm_PersonId":"Person",
   "Comm_Action":"Action",
   "Comm_DateTime":"Date / Time",
   "Comm_OpportunityId":"Regarding",
   "Comm_Status":"Status",
   "Comm_Subject":"Subject",
   "Comm_Time":"Time",
   "Comm_Type":"Type",
   "CurrRecordIsbeingEdited":"This record is currently being edited by",
   "DownloadAll":"Download all",
   "DropFilesHere":"Drop files here",
   "EndTime":"End Time:",
   "EndTimeLess":"End Time cannot be less than Start Time",
   "ErrNoPerm":"You do not have the required security permission",
   "HelpToolTip":"Help",
   "None":"-None-",
   "NoneToDisplay":"None to display",
   "Note_CreatedDate":"Date",
   "Print":"Print",
   "ShowOverdue":"Show Overdue Tasks",
   "StartTime":"Start Time:",
   "Tasks":"Tasks",
   "agenda":"Agenda",
   "allDayEvent":"You cannot drag and drop this type of appointment in this calendar.",
   "calendarApptForbiddenError":"You cannot create an appointment on this calendar.",
   "comm_action":[
      {
         "caption":"Demo",
         "value":"Demo"
      },
      {
         "caption":"E-mail In",
         "value":"EmailIn"
      },
      {
         "caption":"E-mail Out",
         "value":"EmailOut"
      },
      {
         "caption":"Drip Marketing E-mail",
         "value":"EMarketingDripEmail"
      },
      {
         "caption":"E-marketing E-mail",
         "value":"EMarketingEmail"
      },
      {
         "caption":"Fax In",
         "value":"FaxIn"
      },
      {
         "caption":"Fax Out",
         "value":"FaxOut"
      },
      {
         "caption":"Letter In",
         "value":"LetterIn"
      },
      {
         "caption":"Letter Out",
         "value":"LetterOut"
      },
      {
         "caption":"Meeting",
         "value":"Meeting"
      },
      {
         "caption":"Phone In",
         "value":"PhoneIn"
      },
      {
         "caption":"Phone Out",
         "value":"PhoneOut"
      },
      {
         "caption":"SMS Out",
         "value":"SMSOut"
      },
      {
         "caption":"To Do",
         "value":"ToDo"
      },
      {
         "caption":"Vacation",
         "value":"Vacation"
      }
   ],
   "comm_status":[
      {
         "caption":"Cancelled",
         "value":"Cancelled"
      },
      {
         "caption":"Complete",
         "value":"Complete"
      },
      {
         "caption":"In Progress",
         "value":"InProgress"
      },
      {
         "caption":"Pending",
         "value":"Pending"
      }
   ],
   "comm_type":[
      {
         "caption":"Appointments Only",
         "value":"Appointment"
      },
      {
         "caption":"Tasks Only",
         "value":"Task"
      }
   ],
   "company":"Company",
   "day":"Day",
   "details":"Details",
   "drilldown":"More Details",
   "end":"End",
   "location":"Location",
   "month":"Month",
   "organizer":"Organiser",
   "person":"Person",
   "phone":"Phone",
   "start":"Start",
   "tasklist":"Tasks",
   "user":"User",
   "week":"Week",
   "workweek":"Work Week"
}

The returned data will be translated according to the user credentials that were used to create the session.

  • Awesome!  Looking forward to exploring Sage CRM data through the Web Service.  I have not really had an opportunity to explore this for Sage CRM. Since we can get to the SQL data without a Web Service, this does not come to mind often.  However, it is a good reminder of what can be provided to developers wishing to interact with Sage CRM data that don't have direct access to the SQL data.  :-)