Developer Platform (January 2018)

Change some profile data

«  Getting started with the first sample   ·  [   home  ·   reference  ·   community   ·  search   ·  index   ·  routing table   ·  scopes table   ]   ·  Fetch final grade values for an instructor's classes  »

The second sample is quite similar to the first Basic sample. It builds, simply, upon the first sample to demonstrate how to make a simple change to existing data on the server.

It uses the get my profile route to retrieve the calling user’s profile. If you change one of the field values shown from the profile, then it uses the update my profile route to update the profile on the server.

This sample shows you the next step:

Walk-through. This sample provides new functionality built on a framework very similar to the first sample: through a simple-web form, you can change the contents of a few profile properties, and update the server with your changes. Deploy the sample appropriate for the platform you want, and run it, and use it in the same fashion you did the first sample:

  1. Click the Authenticate button.
    • The form redirects your browser to the D2L login page hosted on http://lms.valence.desire2learn.com.
    • Fill out your test user name and password for the service (authenticating yourself as a user), and click Login.
    • The service redirects you back to your sample web-form.
    • The form makes a call to the service’s get my profile route to retrieve the current user’s profile data.
  2. Change any of the shown profile properties you want, and click on the Update profile button.
    • The form makes a call to the service’s update my profile route and shows the updated profile JSON data sent back so you can verify the update.

Python

This sample for the Python platform has the same requirements as the Python client library. You will also require the Bottle, and Beaker Python packages, as the sample is implemented as a simple web services application in a Bottle framework using Beaker to manage session state data.

To install. First download the latest version of the Python sample. Then, unzip the contents into a temporary folder.

To run the sample. Run the profileChange.py script within the appropriate sub-directory in the samples folder to start the Bottle web-service application. Then, in a web-browser, navigate to http://localhost:8080/start.

«  Getting started with the first sample   ·  [   home  ·   reference  ·   community   ·  search   ·  index   ·  routing table   ·  scopes table   ]   ·  Fetch final grade values for an instructor's classes  »