Valence v2.2

ePortfolio Comments and Tags

«  ePortfolio Invites   ·  [   home  ·   reference   ·  index   ·  routing table   ·  modules   ]   ·  ePortfolio Presentation  »

Contents

Attributes

OWNERSHIPFILTER_T

Comments can be retrieved in a batch that’s filtered by ownership (of the objects themselves, and the comments upon them). We use the term OWNERSHIPFILTER_T to stand in for an appropriate integer value:

Filter type Value
All 1
Mine 2
Others 3
TAG_T

Tags assigned to EP objects can be private (for the object owner’s use only) or public. We use the term TAG_T to stand in for an appropriate integer value:

Tag type Value
Public 0
Private 1
EP.Comment

Users can attach comments to EP objects. The service provides them to clients like this:

{
    "ObjectId": "<number:D2LID>",
    "CommentId": "<number:D2LID>",
    "UserId": "<number:D2LID>",
    "CreatedDate": "<string:UTCDateTime>|null",
    "Body": "<string>"
}
EP.TagObject
{
    "Text": "<string>",
    "Type": "<number:TAG_T>"
}

Comment Actions

DELETE /d2l/api/eP/(D2LVERSION: version)/object/comment/(D2LID: commentId)

Delete a comment from an EP object (identified by provided context chain of object IDs).

Parameters:
Query Parameters:
 
  • context – Context chain of object IDs to follow to find the EP object.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to delete comments from EP object, or no permission to see comments on EP object.
  • 404 – EP object not found, or comment not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.
DELETE /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: objectId)/comment/(D2LID: commentId)

Delete a comment from an EP object (identified by object ID).

Parameters:
  • version (D2LVERSION) – API version.
  • objectId (D2LID) – EP object ID.
  • commentId (D2LID) – Comment ID.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to delete comments from EP object, or no permission to see comments on EP object.
  • 404 – EP object not found, or comment not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.
GET /d2l/api/eP/(D2LVERSION: version)/object/comments/

Retrieve all the comments for an EP object (identified by provided context chain of object IDs).

Parameters:
Query Parameters:
 
  • context – Context chain of object IDs to follow to find the EP object.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see comments on EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Return. This action retrieves a paged result set containing, in a single page, the resulting Comments attached to the identified EP object.

GET /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: id)/comments/

Retrieve all the comments for an EP object (identified by object ID).

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see comments on EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Return. This action retrieves a paged result set containing, in a single page, the resulting Comments attached to the identified EP object.

GET /d2l/api/eP/(D2LVERSION: version)/objects/(OWNERSHIPFILTER_T: objectsFilter)/comments/(OWNERSHIPFILTER_T: commentsFilter)

Retrieve a filtered list of comments for EP objects.

Parameters:
  • version (D2LVERSION) – API version.
  • objectsFilter (OWNERSHIPFILTER_T) – An ownership filter to limit the list of EP objects considered.
  • commentsFilter (OWNERSHIPFILTER_T) – An ownership filter to limit the list of comments considered.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see comments on EP objects.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Return. This action retrieves a paged result set containing, in a single page, the filtered list of Comments attached to EP objects.

POST /d2l/api/eP/(D2LVERSION: version)/object/comments/new

Create a new comment on an EP object (identified by provided context chain of object IDs).

Parameters:
Query Parameters:
 
  • context – Context chain of object IDs to follow to find the EP object.
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid comment data provided.
  • 403 – No permission to attach comments to EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a single JSON string containing the comment to attach to the object:

"<string>"

Return. This action returns the CommentId for the newly created comment as a single value.

POST /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: id)/comments/new

Create a new comment on an EP object (identified by object ID).

Parameters:
Status Codes:
  • 200 – Action succeeded.
  • 400 – Invalid comment data provided.
  • 403 – No permission to attach comments to EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a single JSON string containing the comment to attach to the object:

"<string>"

Return. This action returns the CommentId for the newly created comment as a single value.

Tag Actions

GET /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: id)/tags/

Retrieve all the tags associated with an EP object (identified by EP object ID).

Parameters:
  • version (D2LID) – API version.
  • id (D2LID) – EP object ID.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to see EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Return. This action returns a JSON array of TagObject data blocks containing all the tags assigned to the object.

GET /d2l/api/eP/(D2LVERSION: version)/objects/tags/

Retrieve all the tags associated with a set of EP objects.

Parameters:
  • version (D2LID) – API version.
Query Parameters:
 
  • objects – Comma-separated list of EP object IDs.
Status Codes:
  • 200 – Action succeeded.
  • 400 – Badly formated list of EP object IDs provided.
  • 403 – No permission to see EP objects.
  • 404 – No EP objects found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Return. This action returns a JSON structure mapping the EP object IDs you provided (as JSON property names) onto the TagObject data blocks associated with each EP object ID, like this:

{
    "<string:EP Object ID>": [
      "{composite:EP.TagObject}",
      "{composite:EP.TagObject}"
      "...",
    ],
    "<string:EP object ID>": [
      "{composite:EP.TagObject}",
      "{composite:EP.TagObject}"
      "...",
    ],
    "..."
}
POST /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: id)/tags/add

Add one or more tags to an EP object.

Parameters:
  • version (D2LID) – API version.
  • id (D2LID) – EP object ID.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to add tags to EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a JSON array containing one or more TagObject data blocks containing the tags you want to add to the identified EP object.

This action will not remove any tags from the object: it looks through your list and adds any new tags from your list to the object, leaving its existing list intact.

POST /d2l/api/eP/(D2LVERSION: version)/object/(D2LID: id)/tags/remove

Remove one or more tags from an EP object.

Parameters:
  • version (D2LID) – API version.
  • id (D2LID) – EP object ID.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to remove tags from EP object.
  • 404 – EP object not found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a JSON array containing one or more TagObject data blocks containing the tags you want to remove from the identified EP object.

POST /d2l/api/eP/(D2LVERSION: version)/objects/tags/add

Add one or more tags to a set of EP objects.

Parameters:
  • version (D2LID) – API version.
Query Parameters:
 
  • objects – Comma-separated list of EP object IDs.
Status Codes:
  • 200 – Action succeeded.
  • 400 – Badly formatted list of EP object IDs provided.
  • 403 – No permission to add tags to EP objects.
  • 404 – No EP objects found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a JSON array containing one or more TagObject data blocks containing the tags you want to add to all the identified EP objects.

This action will not remove any tags from any of the objects, nor does it let you apply different sets of tags to different objects from the list. Effectively, this action behaves the same way as making a series of calls to the add action on a single object ID.

Note also that this action reports success as long as it succeeds to act upon one of the EP objects from your provided list.

POST /d2l/api/eP/(D2LVERSION: version)/objects/tags/remove

Remove one or more tags from a set of EP objects.

Parameters:
  • version (D2LID) – API version.
Query Parameters:
 
  • objects – Comma-separated list of EP object IDs.
Status Codes:
  • 200 – Action succeeded.
  • 400 – Badly formatted list of EP object IDs provided.
  • 403 – No permission to remove tags from EP objects.
  • 404 – No EP objects found.
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a JSON array containing one or more TagObject data blocks containing the tags you want remove from the indentified EP objects.

This action behaves the same way as making a series of calls to the remove action on a single object ID. Note also that this action reports success as long as it succeeds to act upon one of the EP objects from your provided list.

POST /d2l/api/eP/(D2LVERSION: version)/tags/autocomplete

Find a list of tags that match a tag template you provide.

Parameters:
  • version (D2lID) – API version.
Status Codes:
  • 200 – Action succeeded.
  • 403 – No permission to match against private tags (if provided tag template included private type)
API Versions:
  • 2.0+ – Route first appears in EP v3.5.1.

Input. In your post body, provide a single TagObject JSON data block to act as a template to match against. This action uses the Text property in your template as a prefix string to match against known tag values.

If you set the Type property to 1 (Private), this action looks for matches amongst the list of known private-type tags (if you have permission to do so).

Return. This action returns a JSON array of known TagObject data blocks that all have your tag template’s Text property as a matching prefix for their Text properties.


comments powered by Disqus

«  ePortfolio Invites   ·  [   home  ·   reference   ·  index   ·  routing table   ·  modules   ]   ·  ePortfolio Presentation  »