Pearson
Always Learning

This is a basic course launch SSO Entry Point; using this API will give you a URL for launching the user to the course home screen.

For security reasons, the returned URL endpoint is valid only for a few minutes (typically, 5 minutes). Once the user accesses the URL endpoint using the session ID, the session will follow standard user access token timeouts.

See Courses for the resources that provide access to the course contents and structure within LearningStudio.

Note: This API follows the same conventions and authentication protocols as the Course APIs, including the use of overloads. You can also use the Core Library to streamline your use of this API.

Supported Roles and Authentication Protocols

Type Supported Values
Valid for Roles: Administrator, Professor, Teaching Assistant, Student
Authentication Protocols OAuth 1.0a, OAuth 2.0

API Request

API Endpoint

You will use a POST request to the following URI.

URI

/users/{userId}/courses/{courseId}/courseEntry{.format}

Parameters

The Last Activity Feed v2 is an aggregation of the most recent activities that a user completed within the LearningStudio platform. By default, the activities in this feed span across all the user's courses.

A user can access their own Last Activity feed, or a Professor who is also enrolled in the same course(s) as the user can access the feed. If the user is enrolled in at least one course in which the Professor is not enrolled, then the Professor is not authorized to view the Last Activity feed unless the courseId query string parameter is specified on the request (and both the user and the Professor are enrolled in that course).

How does this differ from WHF?

Note: The resources in this feed follow the activitystrea.ms specification.

Supported Roles and Authentication Protocols

Type Supported Values
Valid for Roles (OAuth 2): Professor, Teaching Assistant, Student
Authentication Protocols OAuth 1.0a, OAuth 2.0

API Request

API Endpoints

HTTP Verbs and URIs

GET /users/{userId}/lastactivityfeed{.format}?v=2

  • Retrieves the Last Activity for the specified user.

Parameters

Parameter Description Valid Values
{userId} LearningStudio User ID or relevant user overload.
  • Numeric ID issued by LearningStudio
  • loginid={clientString}|{username}
  • or replace /users/{userId} with /me
    (OAuth 2 only)
{.format} Desired format of response data. See Response Formats. .json , .xml , or Blank

Query String Parameters

By default, the entire set of Last Activity results is returned for the request. You can filter the list of results using these query parameters; these parameters can be combined to further filter results.

Important: The first query string parameter, v is required and must be set to 2, otherwise version 1 of this API will be returned (which will soon be deprecated). All others are optional.

Query Parameter Name Description Valid Values
v This parameter specifies the version of the API. It is required to be set to 2. (Version 1 is deprecated). 2
courseid Limit the results to the activity of particular course ID. Multiple IDs can be specified, separated by commas. If not set, activity from all of the user's courses will be included. Example:
courseid=123456 or courseid=123456,78901
A valid LearningStudio Course ID. (Call Number overloads are not supported here.)
types Limit the results to the type of activity. Multiple types can be specified, separated by commas. If not set, all activity will be included. Example:
types=thread-pot or types=thread-post,thread-topic
thread-post
thread-topic
grade
dropbox-submission
exam-submission
remark
after Only includes activity from after this date (this is the start-date of a date range.) ISO-8601 timestamp, in UTC. Example:
2013-02-01T00:00:00Z
before Only includes activity from before this date (this is the end-date of a date range.) ISO-8601 timestamp, in UTC. Example:
2013-02-01T00:00:00Z

Examples

GET /me/lastactivityfeed?v=2&types=thread-post,remark

  • Return only the recent thread post and remark activity.

GET /users/12345/lastactivityfeed?v=2&courseid=012345&after=2014-09-01T00:00:00Z

  • Returns activity from after midnight on Sept 1 (UTC) and only from course ID 012345.

Request Body

None

API Response

HTTP Status Codes & Headers

This API returns the standard HTTP Status Codes used by the LearningStudio APIs. There are no special headers returned by the API.

Response Body

Format

{
  "activityStream": {
    "title": "{activityStreamTitle}",
    "items": [{
      "id": "http://api.learningstudio.com/courses/{courseId}/dropboxbaskets/{dropbasketId}/messages/{messageId}",
      "postedTime": "{postedDateTime}",
      "actor": {
        "role": "{userRole}",
        "referenceId": {referenceId},
        "id": "http://api.learningstudio.com/users/{userId}",
        "title": "{userName}",
        "objectType": "{actorObjectType}"
      },
      "verb": "{verb}",
      "object": {
        "courseId": {courseId},
        "attachments": [],
        "referenceId": {referenceId},
        "id": "http://api.learningstudio.com/courses/{courseId}/dropboxbaskets/{dropbasketId}messages/{messageId}",
        "summary": "{summaryText}",
        "objectType": "{objectObjectType}"
      },
      "target": {
        "courseId": {courseId},
        "referenceId": {referenceId},
        "id": "http://api.learningstudio.com/courses/{courseId}/dropboxbaskets/{dropbasketId}",
        "title": "{targetTitle}",
        "objectType": "{targetObjectType}"
      }
    }],
    "lang": "{language}",
    "id": "http://api.learningstudio.com/users/{userId}/lastactivityfeed",
    "subject": {
      "referenceId": {referenceId},
      "id": "http://api.learningstudio.com/users/{userId}",
      "title": "{userId}",
      "objectType": "http://activitystrea.ms/schema/1.0/person"
    }
  }
}

Property Descriptions

Each activity item contains one of each of the following properties:

  • actor - user for which the activity happened.
  • object - type of activity that happened.
  • target - location where activity happened.
Name Description Valid Values
{activityStreamTitle} Title for the activity stream.
id Link to related resources.
{postedDateTime} Date and time the activity feed was created.
{userRole} Specifies the user's role in the course in which the activity happened.
  • PROF - Professor
  • TAST - Teaching Assistant
  • STUD - Student
  • DROP -
{referenceId} ID of the item refered to in the objectType.
{actorObjectType} The type of actor (user) for which the activity is recorded.
{verb} The action that ocurred.
{courseId} LearningStudio course ID in which the activity took place.
{summaryText} Summary text associated with the object.
{objectObjectType} The type of object in which the activity took place.
  • dropbox-submission - Also includes the attachments property
  • thread-topic
  • thread-post
  • grade - Also includes the letter grade and pointsAchieved properties.
  • remark
  • exam-submission
{targetTitle} Title of the a target referred to in the objectType.
{targetObjectType} The type of target in which the activity took place.
  • dropbox-basket
  • thread-topic
  • gradable-item - Also includes the itemType and pointsPossible properties.
  • exam - Also includes the courseitemId property.
  • course
{language} Language associated with the feed.

Example

Request

Endpoint

GET http://api.learningstudio.com/users/123456/lastactivityfeed

Response

Body

{
  "activityStream": {
    "title": "Activity Feed for 654321",
    "items": [{
      "id": "http://api.learningstudio.com/courses/123456/dropboxbaskets/4989/messages/895",
      "postedTime": "2011-02-24T21:16:17Z",
      "actor": {
        "role": "STUD",
        "referenceId": 456456,
        "id": "http://api.learningstudio.com/users/456456",
        "title": "Jane Doe",
        "objectType": "enrolled-user"
      },
      "verb": "submit",
      "object": {
        "courseId": 123456,
        "attachments": [],
        "referenceId": 895,
        "id": "http://api.learningstudio.com/courses/123456/dropboxbaskets/4989/messages/895",
        "summary": "Here is my submission.",
        "objectType": "dropbox-submission"
      },
      "target": {
        "courseId": 123456,
        "referenceId": 4989,
        "id": "http://api.learningstudio.com/courses/123456/dropboxbaskets/4989",
        "title": "Assignment 1",
        "objectType": "dropbox-basket"
      }
    }],
    "lang": "en-us",
    "id": "http://api.learningstudio.com/users/654321/lastactivityfeed",
    "subject": {
      "referenceId": 654321,
      "id": "http://api.learningstudio.com/users/654321",
      "title": "654321",
      "objectType": "http://activitystrea.ms/schema/1.0/person"
    }
  }
}

Note on Using XML Format

If you designate that the response is returned in XML format, you must perform an additional step to properly format the returned URL endpoint. The XML parser automatically encodes the ampersand character (&) as & within the returned URL endpoint. You must convert the encoded character back into the literal ampersand character (i.e., URL-decode) before redirecting the user to the URL.

Request Body

Sending a request body is optional for this API, but note that the exitUrl and logoutUrl properties are strongly recommended.

Format

{
  "webEntry" : {
    "sessionId" : "{sessionId}",
    "exitUrl" : "{exitUrl}",
    "logoutUrl" : "{logoutUrl}"
  }
}

Property Descriptions

Name Description Valid Values Required?
{sessionId} Session ID to be used for subsequent transactions to the course.
  • value - Designate session ID if manual management of the session is desired. Must be unique to the user. We recommend a GUID value.
  • blank - System will auto-generate a new session ID, but will not return it.
No
{exitUrl} Redirect URL for when the user exits LearningStudio. Used for the Close or Exit button in the UI. Fully qualified URL No, but highly recommended
{logoutUrl} Redirect URL for when the user logs out of LearningStudio. Used for the Logout button in the UI. Fully qualified URL No, but highly recommended

API Response

HTTP Response Codes and Errors

This API returns the standard code for successful transactions. See LS Entry Error Codes for details on errors you might see with this API.

Response Body

Format

{
  "courseEntry": {
    "entryUrl": "{entryUrl}"
  }
}

Property Descriptions

Name Description
{entryUrl} URL to which you'll redirect the user's browser. No additional authentication or parameters are required.

Example

Request

Endpoint

POST https://api.learningstudio.com/users/12345/courses/98765/courseEntry

Request Body

{
  "courseEntry" : {
    "exitUrl" : "http://example.edu/return",
    "logoutUrl" : "http://example.edu/logout"
  }
}

Response

Body

{
   "courseEntry": {
       "entryUrl":"http://transferauthentication.next.ecollege.com/Main/AdminMode/TranslateToken/TranslateAndRedirectFromPSHView.ed?token={token}&redirectUrl={url}&createNewCookie=true&returnUrl=http%3a%2f%2fexample.edu%2freturn&logoutUrl=http%3a%2f%2fexample.edu%2flogout&S=3506604d55a94a638049593b011f7f97"
   }
}

Redirect

You'll send this HTTP header to your users' browser.

HTTP/1.1 302 Found
Location: http://transferauthentication.next.ecollege.com/Main/AdminMode/TranslateToken/TranslateAndRedirectFromPSHView.ed?token={token}&redirectUrl={url}&createNewCookie=true&returnUrl=http%3a%2f%2fexample.edu/return&logoutUrl=http%3a%2f%2fexample.edu/logout&S=3506604d55a94a638049593b011f7f97
2588 reads
Always Learning
Pearson