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 Artifiact 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: query filters and preset 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.
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. A 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 |
| id | =, >, <, >=, <= | Org ID of the acted-upon eP object’s owner |
| 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".
Actions¶
- GET /d2l/api/eP/(D2LVERSION: version)/activity/¶
Retrieve a combined list of all activity on EP Objects owned by, or shared to, the current user.
Parameters: - version (D2LVERSION) – API version.
Query Parameters: - filter – Optional. Preset filter ID to apply to the result set; may appear more than once (i.e. filter=5qYZyQ2sEw&filter=DtyQckZ0VD).
- q – Optional. String to act as a query filter on the result set.
- bookmark – Optional. Bookmark to use for fetching the next data set segment.
- pagesize – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes: - 200 – Action succeeded.
- 400 – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions: - 2.0 – Route first appears in EP v3.5.1.
- 2.1+ – Route adds support for the filter query parameter in EP v4.0.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/(D2LVERSION: version)/activity/filters/¶
Retrieve a list of all available preset filters.
Parameters: - version (D2LVERSION) – API version.
Status Codes: - 200 – Action succeeded.
API Versions: - 2.1+ – Route first appears in EP v4.0.0
Return. This action returns a JSON array of preset filter data blocks.
- GET /d2l/api/eP/(D2LVERSION: version)/activity/my/¶
Retrieve a list of all activity on EP Objects owned by the current user.
Parameters: - version (D2LVERSION) – API version.
Query Parameters: - q – Optional. String to act as a query filter on the result set.
- bookmark – Optional. Bookmark to use for fetching next data set segment.
- pagesize – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes: - 200 – Action succeeded.
- 400 – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions: - 2.0+ – Route first appears in EP v3.5.1.
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.
Retrieve a list of all activity on EP Objects shared to the current user.
Parameters: - version (D2LVERSION) – API version.
Query Parameters: - q – Optional. String to act as a query filter on the result set.
- bookmark – Optional. Bookmark to use for fetching next data set segment.
- pagesize – Optional. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes: - 200 – Action succeeded.
- 400 – Invalid query string filter provided, or invalid page size provided, or unable to create list of results.
API Versions: - 2.0+ – Route first appears in EP v3.5.1.
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.
Dashboard activity¶
- GET /d2l/api/eP/(D2LVERSION: version)/dashboard/¶
Retrieve a set of current EP dashboard activity.
Parameters: - version (D2LVERSION) – API version.
Query Parameters: - filter – Optional. Set of dashboard activity filters.
- q – Optional. String to act as a query filter on the returned result set.
- search – Optional. Search value.
- bookmark – Optional. Bookmark to use for fetching the next data segment.
- activityPerItem – Optional. Number of activies to retrieve (maximum) per dashboard item.
- pagesize – Optional number. Number of entries to retrieve in a single data set segment; if present, must be 1 or greater.
Status Codes: - 200 – Action succeeded.
- 400 – Invalid or unusable query string filter provided, or invalid page size provided.
API Versions: - 2.2+ – Route first appears in EP v4.1.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 it’s 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.
- GET /d2l/api/eP/(D2LVERSION: version)/dashboard/filters/¶
Retrieve a list of all preset filters available to the dashboard.
Parameters: - version (D2LVERSION) – API version.
API Versions: - 2.2+ – Route first appears in EP v4.1.0.
Return. This action returns a JSON array of preset filter data blocks.
comments powered by Disqus