corporateacademy-library

Methods

(static) addChilds(childsId, parentId, isDraft, token) → {Item}

Add new childs to parent

Parameters:
Name Type Description
childsId Array.<string>

Required by the action: The ids of the items to add to parent

parentId string

Required by the action: The parent to which add the childs

isDraft string | boolean

Optional by the action: If true, it will be reload the draft of the Item

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/add-childs
Returns:

The updated parent object

Type
Item

(static) addTakersFromUsersImport(importId, attributesMappings, token) → {boolean}

Add item takers from a generic users import

Parameters:
Name Type Description
importId string

Required by the action: The importId field obtained by call import-users-from-file service

attributesMappings MapById.<number>

Optional by the action: between the import columns and the desired attribute types to create on each taker

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/add-takers-from-users-import/:itemId
Returns:

The object result of the operation

Type
boolean

(static) addVisibilities(itemId, destination, groupIds, visibility, visibilityType, ignoreVisibility, fromAdmin, publicItem, forceMailAndNotification, isProject, token) → {Item}

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item object

destination User | UserGroup

Required by the action: The user full object of the user i'm suggesting to

groupIds Array.<string>

Required by the action: Ids of the groups that user belongs to (empty array if no group)

visibility ItemVisibility

Required by the action: The new visibility to insert

visibilityType string

Optional by the action: The type of visibility to insert

ignoreVisibility boolean | string

Optional for the action: If true the item is loaded even if the user has no right on the object

fromAdmin string | boolean

Optional by the action: If true, the item is suggested from an Admin

publicItem string | boolean

Optional by the action: If true, the item will be public

forceMailAndNotification string | boolean

Optional by the action: If true, mail and notifications will be sent

isProject string | boolean

Optional by the action: If true, mail and notifications will be redirect to the project

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/add-visibilities
Returns:

The updated item object

Type
Item

(static) addVisibilitiesFromUsersImport(importId, token) → {boolean}

Delete import tmp data

Parameters:
Name Type Description
importId string

Required by the action: The importId field obtained by call import-users-from-file service

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/add-visibilities-from-users-import/:itemId
Returns:

The object result of the operation

Type
boolean

(static) addVisibility(itemId, destination, groupIds, visibility, visibilityType, ignoreVisibility, fromAdmin, publicItem, forceMailAndNotification, isProject, token) → {Item}

Add a new visibility option (invitation, visibility, etc) to an item

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item object

destination User | UserGroup

Required by the action: The user full object of the user i'm suggesting to

groupIds Array.<string>

Required by the action: Ids of the groups that user belongs to (empty array if no group)

visibility ItemVisibility

Required by the action: The new visibility to insert

visibilityType string

Optional by the action: The type of visibility to insert

ignoreVisibility boolean | string

Optional for the action: If true the item is loaded even if the user has no right on the object

fromAdmin string | boolean

Optional by the action: If true, the item is suggested from an Admin

publicItem string | boolean

Optional by the action: If true, the item will be public

forceMailAndNotification string | boolean

Optional by the action: If true, mail and notifications will be sent

isProject string | boolean

Optional by the action: If true, mail and notifications will be redirect to the project

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/add-visibility
Returns:

The updated item object

Type
Item

(static) changeLibraryTakersEnrollStatus(token) → {boolean}

Changes the status of the specified takers for the specified edition. If an enroll already exists, only a new status will be created. Otherwise a new enroll will be created.

Parameters:
Name Type Description
param.newStatus string

Required: The new status in which the takers will be updated

param.takerIds Array.<string>

Required: Ids of the takers which status (for the specified edition) needs to be updated

param.syllabusItemId string

Required: Syllabus's itemId

param.stageItemId string

Required: Stage's itemId

param.editionItemId string

Required: Edition's itemId

param.mailSenderId string

Required (if sendEmails is true): Id of the mail sender to use

param.mailCC string

Optional: CC's of the mails

param.mailBCC string

Optional: BCC's of the mails

param.signatureId string

Required (if sendEmails is true): Id of the template of the signature. It will be added as a marker.

param.messageBodyAddOn string

Optional: Additional text. It will be added as a marker.

param.textTemplateId string

Required (if sendEmails is true): Id of the mail's template

param.testOnly boolean

Required: If true, the emails will be sent to the logged user and not to the specified users and no data will be created/modified (ie: enrolls, engagements)

param.sendEmails boolean

Required: If true, an email will be sent to the users notifying the status change

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/change-library-takers-enroll-status
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) confirmDraft(itemId, withChildsLoaded, visibilities, indexItem, addPublicVisibility, token) → {Item}

Promote a draft to effective item

Parameters:
Name Type Description
itemId string

Required by the action: The item object with alla relevant data set

withChildsLoaded string | boolean

Optional for the action: If true all childs object are loaded into childObject

visibilities Array.<ItemVisibility>

Optional for the action: Item visibilities to add, if needed

indexItem boolean | string

Optional for the action: If true the document will be indexed in external search engine

addPublicVisibility boolean | string

Optional for the action: If true it will be add a public visibility

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/confirm-draft
Returns:

The new created item object

Type
Item

(static) countAllMyLearningPlans(title, token) → {number}

Retrieve learning plans' count of logged user

Parameters:
Name Type Description
title string

Optional by the action: The searched text that will be matched in the title of the Learning Plan

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-all-my-learning-plans
Returns:

Retrieved Learning Plan count

Type
number

(static) countCardCovers(title, itemIds, itemTypes, parentOf, attributeTypes, attributeValues, attributeRefTypes, attributeRefIds, withAttributesLoaded, withAllVisibiltiesLoaded, withChildsLoaded, ignoreVisibility, myOnly, token) → {number}

List all card covers that match the passed criterias

Parameters:
Name Type Description
title string

Optional for the action: The title of the item (like search)

itemIds string | Array.<string>

Optional for the action: The item id(s)

itemTypes string | Array.<string>

Optional for the action: The item type(s)

parentOf string | Array.<string>

Optional for the action: The child item id(s)

attributeTypes string | Array.<string>

Optional for the action: The attribute type(s) items must have

attributeValues string | Array.<string>

Optional for the action: The attribute value(s) items must have

attributeRefTypes string | Array.<string>

Optional for the action: The attribute reference type(s) items must have

attributeRefIds string | Array.<string>

Optional for the action: The attribute reference id(s) items must have

withAttributesLoaded boolean

Optional for the action: If true, all attributes object are loaded into crossReferenceObject

withAllVisibiltiesLoaded boolean

Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds

withChildsLoaded boolean

Optional for the action: If true all childs object are loaded into childObject

ignoreVisibility boolean

Optional for the action: If true the item is loaded even if the user has no right on the object

myOnly boolean

Optional for the action: If true retrieves only items creared by the user

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-card-covers
Returns:

Retrieved users count

Type
number

(static) countDrafts(searchedText, itemIds, itemTypes, parentOf, attributeTypes, attributeValues, attributeRefTypes, attributeRefIds, withAttributesLoaded, withAllVisibiltiesLoaded, withChildsLoaded, ignoreVisibility, myOnly, token) → {number}

Count all drafts that match the passed criterias

Parameters:
Name Type Description
searchedText string

Optional for the action: The title of the item (like search)

itemIds string | Array.<string>

Optional for the action: The item id(s)

itemTypes string | Array.<string>

Optional for the action: The item type(s)

parentOf string | Array.<string>

Optional for the action: The child item id(s)

attributeTypes string | Array.<string>

Optional for the action: The attribute type(s) items must have

attributeValues string | Array.<string>

Optional for the action: The attribute value(s) items must have

attributeRefTypes string | Array.<string>

Optional for the action: The attribute reference type(s) items must have

attributeRefIds string | Array.<string>

Optional for the action: The attribute reference id(s) items must have

withAttributesLoaded boolean

Optional for the action: If true, all attributes object are loaded into crossReferenceObject

withAllVisibiltiesLoaded boolean

Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds

withChildsLoaded boolean

Optional for the action: If true all childs object are loaded into childObject

ignoreVisibility boolean

Optional for the action: If true the item is loaded even if the user has no right on the object

myOnly boolean

Optional for the action: If true retrieves only items creared by the user

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-drafts
Returns:

Retrieved drafts count

Type
number

(static) countTakers(editionItemIds, stageItemId, token) → {MapById.<number>}

Counts the users assigned to an edition or to a list of editions of a specific initiative, or all the users that have been registered in the specified initiative (including the ones who can select independently the edition)

Parameters:
Name Type Description
editionItemIds Array.<string>

Required: Items ids of the editions for which the users will be retrieved

stageItemId string

Optional: Id of the stage for which the users will be retireved

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/count-takers
Returns:

Map<itemId, number> with counters for each itemId plus a "totalCounter" (as key) with the sum of each ones

Type
MapById.<number>

(static) createCertificateItem(title, subTitle, description, externalLinks, itemType, draftOnly, token) → {string}

Function that create

Parameters:
Name Type Description
title string

Required by the action: The name in Kaltura

subTitle string

Optional by the action: The subtitle of the item

description string

Optional by the action: The description of the item

externalLinks Array.<string>

Optional by the action: The list of the external Link

itemType string

Optional for the action: The item type

draftOnly boolean

Optional for the action: If true the document is saved as draft and it will not be active

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-certificate-item
Returns:

The attachmentId of the attachment

Type
string

(static) createExternalItem(title, subTitle, description, externalLinks, itemType, draftOnly, token) → {string}

Function that create

Parameters:
Name Type Description
title string

Required by the action: The name in Kaltura

subTitle string

Optional by the action: The subtitle of the item

description string

Optional by the action: The description of the item

externalLinks Array.<string>

Optional by the action: The list of the external Link

itemType string

Optional for the action: The item type

draftOnly boolean

Optional for the action: If true the document is saved as draft and it will not be active

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-external-item
Returns:

The attachmentId of the attachment

Type
string

(static) createItem(item, indexItem, draftOnly, token) → {Item}

Create a new Item

Parameters:
Name Type Description
item Item

Required by the action: The item object with alla relevant data set

indexItem boolean | string

Optional for the action: If true (and not draft) the document will be indexed in external search engine

draftOnly boolean | string

Optional for the action: If true the document is saved as draft and it will not be active

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-item
Returns:

The new created item object

Type
Item

(static) createItemLangPool(itemId, poolName, langCode, token) → {Item}

Add a new visibility option (invitation, visibility, etc) to an item

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item object

poolName string

Required by the action: Lang Pool Name

langCode string

Required by the action: Language Code

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-item-lang-pool
Returns:

The updated item object

Type
Item

(static) createItemTakerEnrollByExternalObjId(externalObjId, token) → {number}

Create the enroll for course that have the passed externalObjId associated

Parameters:
Name Type Description
externalObjId string

Required: The id of the external obj id associated to the online course

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-item-taker-enroll-by-external-obj-id
Returns:

Operation result

Type
number

(static) createLearningPlan(item, draftOnly, adminMode, originApplicationName, addPublicVisibility, token) → {Item}

Create a new Learning Plan

Parameters:
Name Type Description
item Item

Required for the action: The new Item to add

draftOnly boolean | string

Optional for the action: If true the document is saved as draft and it will not be active

adminMode boolean | string

Optional for the action: If true a public visibility will be added

originApplicationName string

Optional for the action

addPublicVisibility boolean | string

Optional for the action: If true a public visibility will be added

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-learning-plan
Returns:

The new created Learning plan

Type
Item

(static) createPlaylist(item, draftOnly, adminMode, originApplicationName, addPublicVisibility, token) → {Item}

Create a new playlist

Parameters:
Name Type Description
item Item

Required for the action: The new Item to add

draftOnly boolean | string

Optional for the action: If true the document is saved as draft and it will not be active

adminMode boolean | string

Optional for the action

originApplicationName string

Optional for the action

addPublicVisibility boolean | string

Optional for the action: If true a public visibility will be added

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-playlist
Returns:

The new created Learning plan

Type
Item

(static) createProject(item, draftOnly, originApplicationName, addPublicVisibility, token) → {Item}

Create a new Project

Parameters:
Name Type Description
item Item

Required for the action: The new Item to add

draftOnly boolean | string

Optional for the action: If true the document is saved as draft and it will not be active

originApplicationName string

Optional for the action

addPublicVisibility boolean | string

Optional for the action: If true a public visibility will be added

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-project
Returns:

The new created Project

Type
Item

(static) createSection(item, draftOnly, originApplicationName, token) → {Item}

Create a new Section

Parameters:
Name Type Description
item Item

Required for the action: The new Item to add

draftOnly boolean

Optional for the action: If true the document is saved as draft and it will not be active

originApplicationName string

Optional for the action

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/create-section
Returns:

The new created Section

Type
Item

(static) deleteItemTakerEnrollById(takerEnrollId, newStatus, newStatusNote, giveTakesBack, token) → {number}

Count webinars in search from the external search engine

Parameters:
Name Type Description
takerEnrollId string

Required: Id of the item taker enroll to delete

newStatus string

Optional: New status's type. By default its value is USER_STATUS_DELETED

newStatusNote string

Optional: New status's note

giveTakesBack boolean

Optional: If true, the takes assigned to the enroll will be given back to the taker

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-item-taker-enroll-by-id
Returns:

Operation result

Type
number

(static) deleteItemTakerEnrollsByIds(takerEnrollId, newStatus, newStatusNote, giveTakesBack, token) → {number}

Count webinars in search from the external search engine

Parameters:
Name Type Description
takerEnrollId string

Required: Id of the item taker enroll to delete

newStatus string

Optional: New status's type. By default its value is USER_STATUS_DELETED

newStatusNote string

Optional: New status's note

giveTakesBack boolean

Optional: If true, the takes assigned to the enroll will be given back to the taker

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-item-taker-enrolls-by-ids
Returns:

Operation result

Type
number

(static) deleteLearningPlan(itemId, removeAtomicItemsToo, token)

Delete a Learning Plan

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

removeAtomicItemsToo boolean

Optional for the action: If true the method remove also the childs that are atomic items

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-learning-plan/:itemId
Returns:

null

(static) deleteLibraryItem(itemId, removeAtomicItemsToo, token)

Delete an Item

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

removeAtomicItemsToo boolean

Optional for the action: If true the method remove also the childs that are atomic items

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-library-item/:itemId
Returns:

null

(static) deleteProject(itemId, removeAtomicItemsToo, token)

Delete a Project

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

removeAtomicItemsToo boolean

Optional for the action: If true the method remove also the childs that are atomic items

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-project/:itemId
Returns:

null

(static) deleteSection(itemId, removeAtomicItemsToo, token)

Delete a Section

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

removeAtomicItemsToo boolean

Optional for the action: If true the method remove also the childs that are atomic items

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-section/:itemId
Returns:

null

(static) deleteTakers(takerIds, token) → {boolean}

Deletes the specified takers

Parameters:
Name Type Description
takerIds Array.<string>

Required: Ids of the takers to delete

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/delete-takers
Returns:

Return true if no errors were thrown during the execution

Type
boolean

(static) deleteUsersVisibilityImport(importId, token) → {boolean}

Delete import tmp data

Parameters:
Name Type Description
importId string

Required by the action: The importId field obtained by call import-users-from-file service

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/delete-users-visibility-import/:importId
Returns:

The object result of the operation

Type
boolean

(static) enrollItemTaker(userIdToEnroll, groupIdsOfUserToEnroll, usableTakerTypes, enrollItemTaker, itemId, token) → {number}

Count webinars in search from the external search engine

Parameters:
Name Type Description
userIdToEnroll string

Required by the action: the userId to enroll

groupIdsOfUserToEnroll Array.<string>

Required: Group ids of the user to enroll

usableTakerTypes Array.<string>

Required: Possible types of the takers to be used for the enrollment

enrollItemTaker boolean

Optional by the action: Flag that states if the creation must to enroll also the taker to the item

itemId string

Optional for the action: if enrollItemTaker is true it contains the itemId to enroll

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/enroll-item-taker
Returns:

Operation result

Type
number

(static) enrollItemTakers(userIdToEnroll, groupIdsOfUserToEnroll, usableTakerTypes, enrollItemTaker, itemId, token) → {number}

Count webinars in search from the external search engine

Parameters:
Name Type Description
userIdToEnroll string

Required by the action: the userId to enroll

groupIdsOfUserToEnroll Array.<string>

Required: Group ids of the user to enroll

usableTakerTypes Array.<string>

Required: Possible types of the takers to be used for the enrollment

enrollItemTaker boolean

Optional by the action: Flag that states if the creation must to enroll also the taker to the item

itemId string

Optional for the action: if enrollItemTaker is true it contains the itemId to enroll

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/enroll-item-takers
Returns:

Operation result

Type
number

(static) enrollLibraryItemTaker(itemId, token) → {boolean}

Create the item taker enroll for the Library item or Online course

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item linked to the scorm object

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/enroll-library-item-taker
Returns:

Flag indicating the result of the service

Type
boolean

(static) getAllMyLearningPlans(title, fromRecord, numRecords, token) → {Array.<Item>}

Retrieve the list of all my Learning Plan

Parameters:
Name Type Description
title string

Optional for the action: The title of the item (like search)

fromRecord number

Required by the action: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required by the action: The number of records to load

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-all-my-learning-plans/:fromRecord/:numRecords
Returns:

The retrieved Learning Plan list

Type
Array.<Item>

(static) getCardCovers(title, itemIds, itemTypes, parentOf, attributeTypes, attributeValues, attributeRefTypes, attributeRefIds, withAttributesLoaded, withAllVisibiltiesLoaded, withChildsLoaded, ignoreVisibility, myOnly, allData, fromRecord, numRecords, sorting, token) → {Array.<Item>}

List all card corvers that match the passed criterias

Parameters:
Name Type Description
title string

Optional for the action: The title of the item (like search)

itemIds string | Array.<string>

Optional for the action: The item id(s)

itemTypes string | Array.<string>

Optional for the action: The item type(s)

parentOf string | Array.<string>

Optional for the action: The child item id(s)

attributeTypes string | Array.<string>

Optional for the action: The attribute type(s) items must have

attributeValues string | Array.<string>

Optional for the action: The attribute value(s) items must have

attributeRefTypes string | Array.<string>

Optional for the action: The attribute reference type(s) items must have

attributeRefIds string | Array.<string>

Optional for the action: The attribute reference id(s) items must have

withAttributesLoaded boolean

Optional for the action: If true, all attributes object are loaded into crossReferenceObject

withAllVisibiltiesLoaded boolean

Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds

withChildsLoaded boolean

Optional for the action: If true all childs object are loaded into childObject

ignoreVisibility boolean

Optional for the action: If true the item is loaded even if the user has no right on the object

myOnly boolean

Optional for the action: If true retrieves only items creared by the user

allData boolean

Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required)

fromRecord number

Required by the action: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required by the action: The number of records to load

sorting string

Required by the action: Flag that indicates which sort will be used (D: create date desc, T: title asc)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-card-covers/:fromRecord/:numRecords
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) getDraftById(itemId, withChildsLoaded, withAttributesLoaded, skipVisibilitiesHandling, token) → {Item}

Load an Item in its draft version from its id

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

withChildsLoaded string | boolean

Optional for the action: If true all childs object are loaded into childObject

withAttributesLoaded boolean | boolean

Optional for the action: If true, all attributes object are loaded into crossReferenceObject

skipVisibilitiesHandling boolean

Optional: !!! ATTENTION !!! If true, visibilities won't be retrieved. An object retrieved without visibilities must be saved (update-item) with this params too, otherwise all visibilities will be wiped away!

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-draft-by-id/:itemId
Returns:

The retrieved Item

Type
Item

(static) getDrafts(searchedText, itemIds, itemTypes, parentOf, attributeTypes, attributeValues, attributeRefTypes, attributeRefIds, withAttributesLoaded, withAllVisibiltiesLoaded, withChildsLoaded, ignoreVisibility, myOnly, allData, fromRecord, numRecords, sorting, token) → {Array.<Item>}

List all draft version of items that match the passed criterias

Parameters:
Name Type Description
searchedText string

Optional for the action: The title of the item (like search)

itemIds string | Array.<string>

Optional for the action: The item id(s)

itemTypes string | Array.<string>

Optional for the action: The item type(s)

parentOf string | Array.<string>

Optional for the action: The child item id(s)

attributeTypes string | Array.<string>

Optional for the action: The attribute type(s) items must have

attributeValues string | Array.<string>

Optional for the action: The attribute value(s) items must have

attributeRefTypes string | Array.<string>

Optional for the action: The attribute reference type(s) items must have

attributeRefIds string | Array.<string>

Optional for the action: The attribute reference id(s) items must have

withAttributesLoaded boolean

Optional for the action: If true, all attributes object are loaded into crossReferenceObject

withAllVisibiltiesLoaded boolean

Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds

withChildsLoaded boolean

Optional for the action: If true all childs object are loaded into childObject

ignoreVisibility boolean

Optional for the action: If true the item is loaded even if the user has no right on the object

myOnly boolean

Optional for the action: If true retrieves only items creared by the user

allData boolean

Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required)

fromRecord number

Required by the action: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required by the action: The number of records to load

sorting string

Required by the action: Flag that indicates which sort will be used (D: create date desc, T: title asc)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-drafts/:fromRecord/:numRecords
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) getItemById(itemId, withChildsLoaded, createEngagement, ignoreVisibility, withAllVisibiltiesLoaded, loadInvitedInstead, childsTreeDepth, loadInvitationDates, skipVisibilitiesHandling, withRegistration, token) → {Item}

Get the details of an item

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item to retrieve

withChildsLoaded string | boolean

Optional for the action: If true all childs object are loaded into childObject

createEngagement string | boolean

Optional for the action: If true engament events will emitted

ignoreVisibility boolean | boolean

Optional for the action: If true the item is loaded even if the user has no right on the object

withAllVisibiltiesLoaded boolean | boolean

Optional for the action: If true all visibilities object will be loaded, otherwise only ones referred to or originted from the passed userId/groupIds

loadInvitedInstead boolean

Optional for the action: If true for the visibilities the user data that is load are the ones of the invited person instead of the inviter

childsTreeDepth number

Optional: depth in tree of childs to retrieve

loadInvitationDates boolean

Optional: return a map with userId and his invitation dates (usersInvitationDatesMap)

skipVisibilitiesHandling boolean

Optional: !!! ATTENTION !!! If true, visibilities won't be retrieved. An object retrieved without visibilities must be saved (update-item) with this params too, otherwise all visibilities will be wiped away!

withRegistration boolean

Optional for the action: If true include item registrations

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-item-by-id/:itemId
Returns:

The retrieved Item

Type
Item

(static) getSuggestedItems(itemId, numRecords, techSkillsOnly, softSkillsOnly, excludeVisited, withRegistration, token) → {Array.<Item>}

Search the suggested items of the user

Parameters:
Name Type Description
itemId string

Optional for the action: The id of the item user's wants related data

numRecords number

Required by the action: The number of records to load

techSkillsOnly string | boolean

Optional for the action: If set retrieve only specific type of items

softSkillsOnly string | boolean

Optional for the action: If set retrieve only specific type of items

excludeVisited boolean

Optional for the action: If true, items already visited by the user will not showned up (if possible)

withRegistration boolean

Optional for the action: If true include item registrations

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/get-suggested-items
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) importGroupsAsTakers(cidOrEmailList, userIds, itemId, masterItemId, simulate, takersAttributesMapByUserId, token) → {ImportPersonsAsTakersResponse}

Imports the specified persons as takers for the specified item. Only users of the same tenant of the logged user can be imported. If the "simulate" parameter is thruthy, the users (and associated takers) will be analyzed and returned to the client without creating the missing takers.

Parameters:
Name Type Description
cidOrEmailList Array.<string>

Optional: The list of cids or emails of the users to import

userIds Array.<string>

Optional: The list of userIds of the users to import

itemId string

Required (mutually exclusive with masterItemId): The id of the item to which the takers will be associated

masterItemId string

Required (mutually exclusive with itemId): The id of the item to which the takers will be associated

simulate boolean

Optional: If true, the missing takers won't be created but the analyzed list of users will be returned to the client

takersAttributesMapByUserId MapById.<MapById.<string>>

Optional: (map of { userId: {attributeType: attributeValue} }) if provided it adds the takerAttributes for the new user taker created by this service

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/import-groups-as-takers
Returns:

Array of item takers enriched with a set of data useful for the client

Type
ImportPersonsAsTakersResponse

(static) importPersonsAsTakers(cidOrEmailList, userIds, itemId, masterItemId, simulate, webinarUserRole, takersAttributesMapByUserId, eventOptionalParams, token) → {ImportPersonsAsTakersResponse}

Imports the specified persons as takers for the specified item. Only users of the same tenant of the logged user can be imported. If the "simulate" parameter is thruthy, the users (and associated takers) will be analyzed and returned to the client without creating the missing takers.

Parameters:
Name Type Description
cidOrEmailList Array.<string>

Optional: The list of cids or emails of the users to import

userIds Array.<string>

Optional: The list of userIds of the users to import

itemId string

Required (mutually exclusive with masterItemId): The id of the item to which the takers will be associated

masterItemId string

Required (mutually exclusive with itemId): The id of the item to which the takers will be associated

simulate boolean

Optional: If true, the missing takers won't be created but the analyzed list of users will be returned to the client

webinarUserRole number

Optional, mandatory If the stage is a webinar. It's the user role can be specified: SambaLiveUserRoleTypes.PARTICIPANT (2) or SambaLiveUserRoleTypes.SPEAKER (1)

takersAttributesMapByUserId MapById.<MapById.<string>>

Optional: (map of { userId: {attributeType: attributeValue} }) if provided it adds the takerAttributes for the new user taker created by this service

eventOptionalParams MapById.<string>

Optional additional paramters to pass to the taker modification event

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/import-persons-as-takers
Returns:

Array of item takers enriched with a set of data useful for the client

Type
ImportPersonsAsTakersResponse

(static) importTakersFromFile(form, token) → {ImportTemp}

Import users visibilities file

Parameters:
Name Type Description
form Form

form data with file data

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/import-takers-from-file
Returns:

The object result of the import users into a temp table

Type
ImportTemp

(static) isSingletonItemInUse(token) → {boolean}

Check if a user is consuming a singleton object

Parameters:
Name Type Description
token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/is-singleton-item-in-use
Returns:

true if a singleton is in use

Type
boolean

(static) listExistingAttributeValues(attributeType, attributeValue, numRecords, token) → {Array.<string>}

List all existing values for a specific attribute (for autocomplete)

Parameters:
Name Type Description
attributeType string

Required by the action: The attribute type for which retrieve data

attributeValue string

Optional for the action: The value to search

numRecords number

Optional for the action: The number of records to load (default: 10)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/list-existing-attribute-values/:numRecords
Returns:

List of first numRecords attribute values for this attributeType

Type
Array.<string>

(static) listTakers(editionItemIds, stageItemId, fromRecord, numRecords, allData, token) → {Array.<EnrichedItemTaker>|Array.<string>}

Retrieves the users assigned to an edition or to a list of editions of a specific initiative, or all the users that have been registered in the specified initiative (including the ones who can select independently the edition)

Parameters:
Name Type Description
editionItemIds Array.<string>

Required: Items ids of the editions for which the users will be retrieved

stageItemId string

Optional: Id of the stage for which the users will be retireved

fromRecord number

Optional: Offset of the first record to retrieve

numRecords number

Optional: Number of records to retrieve

allData boolean

Optional: All matching rows will be retrieved

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/list-takers/:fromRecord/:numRecords
Returns:

Array of item takers enriched with a set of data useful for the client

Type
Array.<EnrichedItemTaker> | Array.<string>

(static) listUserTakers(itemId, fromRecord, numRecords, allData, token) → {Array.<ItemTakerWrapper>}

Retrieves the users assigned to an edition or to a list of editions of a specific initiative, or all the users that have been registered in the specified initiative (including the ones who can select independently the edition)

Parameters:
Name Type Description
itemId string | Array.<string>

Optional: Id(s) used to filter on the itemId field of the takers

fromRecord number

Optional: Offset of the first record to retrieve

numRecords number

Optional: Number of records to retrieve

allData boolean

Optional: All matching rows will be retrieved

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/list-user-takers
Returns:

Array of item takers enriched with a set of data useful for the client

Type
Array.<ItemTakerWrapper>

(static) markSingletonItemInUse(token)

Mark that a user is consuming a singleton object. The data is stored for 3 seconds, so it must be called cotinuosly

Parameters:
Name Type Description
token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/mark-singleton-item-in-use
Returns:

null

(static) myTakerRolesForItem(itemId, token) → {Array.<string>}

Return the roles of the connected user for the passed itemId

Parameters:
Name Type Description
itemId string

Required: The (webinar) itemId

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/my-taker-roles-for-item/:itemId
Returns:
  • A list of ItemTakerRoles
Type
Array.<string>

(static) removeVisibilities(visibilityId, itemId, token) → {Item}

Remove visibility options (invitation, visibility, etc) from an item

Parameters:
Name Type Description
visibilityId string

Required by the action: The id of the visibility to remove

itemId string

Required by the action: The id of the item object

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/remove-visibilities/:itemId
Returns:

The updated item object

Type
Item

(static) removeVisibility(visibilityId, itemId, token) → {Item}

Remove a visibility option (invitation, visibility, etc) from an item

Parameters:
Name Type Description
visibilityId string

Required by the action: The id of the visibility to remove

itemId string

Required by the action: The id of the item object

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/remove-visibility/:itemId/:visibilityId
Returns:

The updated item object

Type
Item

(static) searchTags(type, creationUserId, title, description, parentId, fromRecord, numRecords, allData, token) → {Array.<Tag>}

Search tags in the external search engine

Parameters:
Name Type Description
type string | Array.<string>

Optional for the action: If passed filters tags by its type

creationUserId string | Array.<string>

Optional for the action: If passed filters tags by its creator

title string

Optional for the action: If passed filters tags by the title of the specific langCode

description string

Optional for the action: If passed filters tags by the description of the specific langCode

parentId string | Array.<string>

Optional for the action: If passed filters tags by their parent

fromRecord number

Required by the action: The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required by the action: The number of records to load

allData boolean

Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/search-tags
Returns:

The matching tags

Type
Array.<Tag>

(static) sendItemInvitations(itemId, userIds, customMailTemplateId, token) → {boolean}

Send item invitations to users

Parameters:
Name Type Description
itemId string

Required by the action: The id of the item object

userIds Array.<string>

Required by the action: user ids to send invitations to

customMailTemplateId string

Optional by the action: custom selected text template id

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/send-item-invitations/:itemId
Returns:

the result of the sent operation

Type
boolean

(static) suggestTags(numRecords, minItemsPerTag, token) → {Array.<Tag>}

This service suggests the user's most impacted tags, by evaluating latest visited item, user's searches and so on. The tags returned could be used, for example, to popolute different bands on a page that suggest to user what to watch or study. ** NOTICE ** The subsequent search or list items for these categories (tag) should not generate a search engagement

Parameters:
Name Type Description
numRecords number

Optional for the action: The number of records to load

minItemsPerTag number

Optional for the action: The number of visible items a tag should contain to be kept (dafults to 5)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP GET /rest-api/corporateacademy-mediator/suggest-tags/:numRecords
Returns:

list of suggested tags

Type
Array.<Tag>

(static) updateDraft(item, token) → {Item}

Update a draft version of an item. All dependent rows/data (childs, attributes, etc), will be erased and recreated, so the whole structure must be passed with the item.

Parameters:
Name Type Description
item Item

Required for the action: The new Item to add

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/update-draft
Returns:

The new created item object

Type
Item

(static) updateItem(item, indexItem, draftOnly, skipVisibilitiesHandling, token) → {Item}

Update an Item

Parameters:
Name Type Description
item Item

Required by the action: The item object with alla relevant data set

indexItem boolean | string

Optional for the action: If true (and not draft) the document will be indexed in external search engine

draftOnly boolean | string

Optional for the action: If true the document is saved as draft and it will not be active

skipVisibilitiesHandling boolean | string

Optional for the action: If true the document is saved ignoring visibilities (won't be erased and reinserted: old values will be kept)

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/update-item
Returns:

The new created item object

Type
Item

(static) updateItemTakerAttributes(itemId, takerId, takerAttributes, token) → {boolean}

Changes the status of the specified takers for the specified edition. If an enroll already exists, only a new status will be created. Otherwise a new enroll will be created.

Parameters:
Name Type Description
itemId Item

Required: Item unique ID

takerId string

Required: Id of the taker that need to be update

takerAttributes Array.<ItemTakerAttribute>

Required: List of ItemTakerAttributes

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/update-item-taker-attributes
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) updatePlayerStatus(itemId, event, totalTime, currentTime, viewedSeconds, token)

Create a new engagement for the item passed based upon DAM Player notifications

Parameters:
Name Type Description
itemId string

The item viewed by the user

event string

The triggered event

totalTime number

The item maximum running time

currentTime number

The item actual time

viewedSeconds number

The viewed seconds

token string

Required: the Authorization Bearer token passed in the Header of the request

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/update-player-status/:itemId/:event/:totalTime/:currentTime
Returns:

null