Developer Platform (October 2022)

Settings for user accounts

«  Users (user data, whoami)   ·  [   home  ·   reference  ·   community   |   search  ·   index   ·  routing table   ·  scopes table   ]   ·  Accommodations  »

The settings actions let an organization manage the account settings available to users. We’ve divided this functionality into two, general groups:

Attributes

Settings.UpdateLocale

When updating a user’s account setting for preferred locale, pass a structure that looks like this one:

{
    "LocaleId": <number:D2LID>
}
LocaleId

System identifier for a particular Locale.

Custom widget data

Settings.WidgetData

When setting custom widget data, pass a structure that looks like this one:

{
    "Data": <string>
}
Data

Widget data to be stored. Note, this data itself should be in json format. Double quotes within the json string must be escaped with a backslash (”\”) as in this example:

{  "Data": "{ \"key\": \"value\" }"  }

Actions

GET /d2l/api/lp/(version)/accountSettings/mySettings/locale/

Retrieve the current user’s locale account settings.

Parameters:
Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

Return. This action returns a Locale JSON block, containing information about the current user’s currently set locale.

GET /d2l/api/lp/(version)/accountSettings/(userId)/locale/

Retrieve the locale account settings for a particular user.

Parameters:
Oauth2 Scopes:

accountsettings:locale:read

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

Return. This action returns a Locale JSON block, containing information about the user’s currently set locale.

PUT /d2l/api/lp/(version)/accountSettings/mySettings/locale/

Update the current user’s locale account settings.

Parameters:
JSON Parameters:
Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

PUT /d2l/api/lp/(version)/accountSettings/(userId)/locale/

Update the locale account settings for a particular user.

Parameters:
JSON Parameters:
Oauth2 Scopes:

accountsettings:locale:update

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

Custom widget data

These actions let you save a modest amount of data for custom widgets within an org unit, both org-unit wide data, and data specific to individual users. Note the custom widget’s HTML body can gain access to the custom widget’s ID by using the {widgetid} replace string.

Note

Currently, you can only store a modest amount of data for each data record you add. A single widget and org unit combination (as well as a widget, org unit and user combination) has a set data limit and the back-end service does not provide a way to determine how much of the storage has already been used.

DELETE /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)

Delete custom widget data for an org unit.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

DELETE /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/mydata

Delete custom widget data for an org unit tied to the current user.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

DELETE /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/(userId)

Delete custom widget data for an org unit tied to a particular user.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

  • userId (D2LID) – User ID.

Status Codes:
API Versions:
  • 1.35+ – Route first appears in LMS v20.22.1.

Input. The target user identified in the route for this action must have their enrollment role set to be visible within the classlist.

GET /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)

Retrieve custom widget data for an org unit.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

Return. This action returns a WidgetData JSON block showing the widget data for the specified custom widget.

GET /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/mydata

Retrieve custom widget data for an org unit tied to the current user.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

Return. This action returns a WidgetData JSON block showing the widget data for the specified custom widget.

GET /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/(userId)

Retrieve custom widget data for an org unit tied to a particular user.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

  • userId (D2LID) – User ID.

Status Codes:
API Versions:
  • 1.35+ – Route first appears in LMS v20.22.1.

Input. Note that the target user identified in the route for this action must have their enrollment role set to be visible within the classlist.

Return. This action returns a WidgetData JSON block showing the widget data for the specified custom widget.

PUT /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)

Update custom data for a widget in an org unit.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

JSON Parameters:
Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

Return. This action returns a WidgetData JSON block showing the widget data for the updated custom widget.

PUT /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/mydata

Update user-specific custom data for a widget in an org unit.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

JSON Parameters:
Status Codes:
API Versions:
  • 1.31+ – Route first appears in LMS v20.21.6.

  • 1.26-1.30Deprecated as of LMS v20.22.1.

  • 1.25-Obsolete as of LMS v20.22.1.

Return. This action returns a WidgetData JSON block showing the widget data for the updated custom widget.

PUT /d2l/api/lp/(version)/(orgUnitId)/widgetdata/(customWidgetId)/(userId)

Update custom data for a widget for an org unit tied to a particular user.

Parameters:
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

  • userId (D2LID) – User ID.

JSON Parameters:
  • CustomWidgetData (Settings.WidgetData) – new JSON config data for spcified user for widget.

Status Codes:
API Versions:
  • 1.35+ – Route first appears in LMS v20.22.1.

Input. Note that the target user identified in the route for this action must have their enrollment role set to be visible within the classlist.

Return. This action returns a WidgetData JSON block showing the widget data for the updated custom widget.

«  Users (user data, whoami)   ·  [   home  ·   reference  ·   community   |   search  ·   index   ·  routing table   ·  scopes table   ]   ·  Accommodations  »