Developer Platform (August 2017)

ePortfolio Activities

«  ePortfolio Data Export/Import   ·  [   home  ·   reference  ·   community   ·  search   ·  index   ·  routing table   ·  scopes table   ]   ·  ePortfolio Invites  »

Contents

Attributes

ACTIVITYACTION_T

EP activities describe actions upon EP objects. We categorize these actions into a number of different general types and use the term ACTIVITYACTION_T to stand in for an appropriate integer value.

Activity action type Value
Create 1
Retrieve 2
Update 3
Delete 4
ACTIVITY_T

EP activities themselves are classified by type according, in general, to the type of the parent EP object the activity pertains to. We use the term ACTIVITY_T to stand in for an appropriate integer value.

Activity Type Value
Collection 1
Reflection 2
Artifact 3
Presentation 4
Comment 5
Assessment 6
Export 7
Import 8
Sharing 9 ^
PushToOthers 10 ^
Invite 11 ^
LearningObjective 12

^ Reserved for future implementation

EP.Activity
{
    "ActionType": <number:ACTIVITYACTION_T>,
    "ActivityTime": <string:UTCDateTime>,
    "ActivityType": <number:ACTIVITY_T>,
    "ObjectId": <number:D2LID>,
    "OrgId": <number:D2LID>,
    "OwnerId": <number:D2LID>,
    "RefObjectId": <string:D2LID>,
    "UserId": <number:D2LID>
}
OrgId
Org ID for the owner of the acted-upon object.
OwnerId
User ID for the user who owns the acted-upon object.
RefObjectId
ID for the referred object: this property’s interpretation is determined by the ActivityType property. If the activity is a Comment (5) or an Assessment (6), then this ID refers to the comment or assessment object; otherwise, it refers to the context chain for the action (the path by which the user obtained access to the acted-upon object).
UserId
User ID for the user who performed the action on the acted-upon object.

Filters

The EP activity service supports two sorts of filters: preset filters and query filters.

Preset filters

As of v4.0.0, the EP activity service can provide a set of preset filters that clients can use to narrow the results returned by the service. Preset filters are identified to the service by ID, and have a display name that clients can show to users. By intention, clients can retrieve a list of all preset filters the service supports, show them in a pick list to the client user and then communicate this selection back to the service with a list of preset filter IDs.

EP.Filter

When the service provides back preset filters to requesting clients, it uses a JSON structure like this:

{
    "Id": <string:D2LID>,
    "Name": <string>
}
Id
Learning System unique ID name for the activity filter.
Name
Localized display name for the activity filter that appears in the EP user interface.

Activity query filters

Many of the EP activity service actions let you set a complex query filter string to narrow the number of elements in the returned result set. An activity query filter consists of one or more simple expressions chained together with the .AND. and .OR. conjunctive operators. Each simple expression tests a single property against a value with a relational operator:

Property Operators Test against…
user =, != User ID value of acting user
owner =, != User ID of acted-upon EP object owner
activitytype =, != Activity type enum value
actiontype =, != Action type enum value
objectid = Acted-upon EP object’s ID
date =, >, <, >=, <= Date of activity occurrence (in ISO 8601 format)

Example. If you want to select for all results shared to user ID 2046 but created on or after 20 May, 2004: ?q="user=2046.AND.date>=2004-05-20".

Newsfeed query filters

The EP activity newsfeed actions let you set a complex query filter string to narrow the number of elements in the returned result set (these are, essentially, a subset of the general activity query filters). A newsfeed query filter consists of one or more sample expressions chained together with the .AND. and .OR. conjunctive operators. Each simple expression tests a single property against a value with a relational operator:

Property Operators Test against…
user = User ID value of acting user
owner != User ID of acted-upon EP object owner
objectid = Acted-upon EP object’s ID

Example. If you want to fetch back the sharing result record for a EP object 1023 shared to user ID 2046: ?q="user=2046.AND.object=1023".

Actions

GET /d2l/api/eP/(version)/activity/

Retrieve a combined list of all activity on EP objects owned by, or shared to, the current user.

Parameters:
Query Parameters:
 
  • filter (EP.Filter) – Optional. Set of preset activity filters
  • q (string) – Optional. Activity query filter expression to narrow results.
  • bookmark (string) – Optional. Bookmark to use for fetching the next data set segment.
  • pagesize (integer) – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes:
  • 200 OK – Action succeeded.
  • 400 Bad Request – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Input. You can apply more than one preset filter to the request by providing the filter query parameter more than once (specifying each filter by its Id value): &filter="MyItemsActivityFilterProviderPlugin"&filter="SharedItemsActivityFilterProviderPlugin", and so on. The service will then return only results that fit within your list of filters.

Return. This action returns a paged result set containing the resulting Activity JSON data blocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).

Note that results are sorted by ActivityDateTime first, in descending order (so that newer activities appear sooner in the returned segments), and then by ActivityId.

GET /d2l/api/eP/(version)/activity/filters/

Retrieve a list of all available preset filters.

Parameters:
Status Codes:
  • 200 OK – Action succeeded.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Return. This action returns a JSON array of preset filter data blocks.

GET /d2l/api/eP/(version)/activity/my/

Retrieve a list of all activity on EP objects owned by the current user.

Parameters:
Query Parameters:
 
  • q (string) – Optional. Query filter expression to narrow results.
  • bookmark (string) – Optional. Bookmark to use for fetching next data set segment.
  • pagesize (integer) – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes:
  • 200 OK – Action succeeded.
  • 400 Bad Request – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Return. This action returns a paged result set containing the resulting Activity JSON data blocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).

Note that results are sorted by ActivityDateTime first, in descending order (so that newer activities appear sooner in the returned segments), and then by ActivityId.

GET /d2l/api/eP/(version)/activity/shared/

Retrieve a list of all activity on EP objects shared to the current user.

Parameters:
Query Parameters:
 
  • q (string) – Optional. Query filter expression to narrow results.
  • bookmark (string) – Optional. Bookmark to use for fetching next data set segment.
  • pagesize (integer) – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes:
  • 200 OK – Action succeeded.
  • 400 Bad Request – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Return. This action returns a paged result set containing the resulting Activity JSON data blocks for the segment following your bookmark parameter (or the first segment if that parameter is empty or missing).

Note that results are sorted by ActivityDateTime first, in descending order (so that newer activities appear sooner in the returned segments), and then by ActivityId.

Newsfeed activity

GET /d2l/api/eP/(version)/newsfeed/
Parameters:
Query Parameters:
 
  • filter (EP.Filter) – Optional. Set of preset newsfeed activity filters.
  • q (string) – Optional. Newsfeed query filter expression to narrow results.
  • search (string) – Optional. Natural search string.
  • bookmark (string) – Optional. Bookmark to use for fetching the next data segment.
  • activityPerItem (integer) – Optional. Number of activities to retrieve (maximum) per dashboard item.
  • pagesize (integer) – Optional number. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes:
  • 200 OK – Action succeeded.
  • 400 Bad Request – Invalid or unusable query string filter provided, or invalid page size provided.
API Versions:
  • 2.5+ – Route first appears in LMS 10.4.0.

Input. You can apply more than one preset filter to the request by providing the filter query parameter more than once (specifying each filter by its Id value): &filter="MyItemsNewsfeedFilterProviderPlugin"&filter="SharedItemsNewsfeedFilterProviderPlugin", and so on. The service will then return only results that fit within your list of filters.

The search parameter gets used as a natural search string as could be typed by the user into the EP dashboard search box: the service will seek to match this string against the names of EP objects being acted upon and the names of users involved in the activity (note that user information privacy gets taken into account here).

Return. This action returns a paged result set containing a list of tupled, key-value pairs where each key is an EP Activity and its associated value is a string.

GET /d2l/api/eP/(version)/newsfeed/filters/
Parameters:
Status Codes:
  • 200 OK – Action succeeded.
API Versions:
  • 2.5+ – Route first appears in LMS 10.4.0.

Return. This action returns a JSON array of preset filter data blocks.

Dashboard activity

Warning

The dashboard activity actions are no longer supported as of EP API version 2.5 and forward; With the publication of EP API v2.5, these dashboard routes are deprecated in version v2.4 and all prior versions.

The newsfeed activity actions replace these routes with v2.5 of the EP API and forward.

GET /d2l/api/eP/(version)/dashboard/

Retrieve a set of current EP dashboard activity.

Parameters:
Query Parameters:
 
  • filter (EP.Filter) – Optional. Set of preset dashboard activity filters.
  • q (string) – Optional. Activity query filter expression to narrow results.
  • search (string) – Optional. Natural search string.
  • bookmark (string) – Optional. Bookmark to use for fetching the next data segment.
  • activityPerItem (integer) – Optional. Number of activities to retrieve (maximum) per dashboard item.
  • pagesize (integer) – Optional number. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes:
  • 200 OK – Action succeeded.
  • 400 Bad Request – Invalid or unusable query string filter provided, or invalid page size provided.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Input. You can apply more than one preset filter to the request by providing the filter query parameter more than once (specifying each filter by its Id value): &filter="MyItemsDashboardFilterProviderPlugin"&filter="SharedItemsDashboardFilterProviderPlugin", and so on. The service will then return only results that fit within your list of filters.

The search parameter gets used as a natural search string as could be typed by the user into the EP dashboard search box: the service will seek to match this string against the names of EP objects being acted upon and the names of users involved in the activity (note that user information privacy gets taken into account here).

Return. This action returns a paged result set containing a list of tupled, key-value pairs where each key is an EP Activity and its associated value is a string.

Warning

As of the Nov 2013 service packs on EP v4.2.0 and later (EP APIs 2.3 and later), the date activity query filter property is no longer supported. While the service will still parse and accept activity query filter expressions that include the date property, it will not be actively used when filtering results.

GET /d2l/api/eP/(version)/dashboard/filters/

Retrieve a list of all preset filters available to the dashboard.

Parameters:
Status Codes:
  • 200 OK – Action succeeded.
API Versions:
  • 2.5+ – Route first appears in LMS v10.4.0.
  • 2.4-Obsolete as of LMS v10.7.0.

Return. This action returns a JSON array of preset filter data blocks.

«  ePortfolio Data Export/Import   ·  [   home  ·   reference  ·   community   ·  search   ·  index   ·  routing table   ·  scopes table   ]   ·  ePortfolio Invites  »