Developer Platform (January 2020)

Settings for user accounts

«  Users (user data, whoami)   ·  [   home  ·   reference  ·   community   |   search  ·   index   ·  routing table   ·  scopes table   ]   ·  Demographics (data types, fields, users and org units)  »

Contents

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 updating 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 “”.

Actions

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

Retrieve the current user’s locale account settings.

Parameters
Status Codes
  • 200 OK – Action succeeded.

  • 403 Forbidden – No permission to see current user’s preferred locale.

API Versions
  • unstable – Route first appears with LMS v10.4.7.

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
Status Codes
API Versions
  • unstable – Route first appears with LMS v10.4.7.

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
  • 200 OK – Action succeeded.

  • 403 Forbidden – No permission to set current user’s preferred locale.

API Versions
  • unstable – Route first appears with LMS v10.4.7.

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

Update the locale account settings for a particular user.

Parameters
JSON Parameters
Status Codes
API Versions
  • unstable – Route first appears with LMS v10.4.7.

Custom widget data

These actions let you save 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 can access to the custom widget’s ID by using the {widgetid} replace string.

DELETE /d2l/api/le/(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.39+ – Route first appears with LMS v20.19.12.

DELETE /d2l/api/le/(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.39+ – Route first appears with LMS v20.19.12.

GET /d2l/api/le/(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
  • 200 OK – Action succeeded.

  • 403 Forbidden – No permission to access custom widget data within the org unit.

  • 404 Not Found – No data is present for the custom widget.

API Versions
  • 1.39+ – Route first appears with LMS v20.19.12.

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

GET /d2l/api/le/(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
  • 200 OK – Action succeeded.

  • 403 Forbidden – No permission for the user to access their own custom widget data.

  • 404 Not Found – No data is present for the custom widget/user.

API Versions
  • 1.39+ – Route first appears with LMS v20.19.12.

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

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

Update custom widget data for an org unit.

Parameters
  • version (D2LVERSION) – API version.

  • orgUnitId (D2LID) – Org unit ID.

  • customWidgetId (D2LID) – Custom widget ID.

JSON Parameters
Status Codes
  • 200 OK – Action succeeded.

  • 400 Bad Request – Widget data not in correct format or data has not been created yet.

  • 403 Forbidden – No permission to modify custom widget data within the org unit.

API Versions
  • 1.39+ – Route first appears with LMS v20.19.12.

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

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

Update 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.

JSON Parameters
Status Codes
  • 200 OK – Action succeeded.

  • 400 Bad Request – Widget data not in correct format or data has not been created yet.

  • 403 Forbidden – No permission for the user to modify their own custom widget data.

API Versions
  • 1.39+ – Route first appears with LMS v20.19.12.

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   ]   ·  Demographics (data types, fields, users and org units)  »