corporateacademy-coursemanager

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 update Learning plan

Type
Item

(static) assignStageToPath(stageItemId, pathItemId, token) → {Item}

Assigns a stage to a path, adding it to the path's children. If the stage is already a children of the path, it won't be assigned again and the service will return the path in its current state.

Parameters:
Name Type Description
stageItemId string

Required: Id of the stage item to assign to the path

pathItemId string

Required: Id of the path item to which the stage will be assigned

token string

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

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/assign-stage-to-path
Returns:

The updated path with all his children loaded

Type
Item

(static) changeCourseTakersEnrollStatus(newStatus, takerIds, syllabusItemId, stageItemId, editionItemId, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, testOnly, sendEmails, 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
newStatus string

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

takerIds Array.<string>

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

syllabusItemId string

Required: Syllabus's itemId

stageItemId string

Required: Stage's itemId

editionItemId string

Required: Edition's itemId

mailSenderId string

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

mailCC string

Optional: CC's of the mails

mailBCC string

Optional: BCC's of the mails

signatureId string

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

messageBodyAddOn string

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

textTemplateId string

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

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)

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-course-takers-enroll-status
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) changePathToStage(pathItemId, online, token) → {Item}

Transforms a path to a stage. On the stage, all the path-related stuff will be removed (ie: supplier-related attributes). A new course module will be created using all the path's data.

Parameters:
Name Type Description
pathItemId string

Required: The itemId of the path that will be transformed

online boolean

Optional: If true, an online stage will be created. By default, the new stage will be a class 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/change-path-to-stage
Returns:

The newly created stage

Type
Item

(static) changeStageFromClassToOnline(stageItemId, token) → {Item}

Modifies the type of a stage from class to online

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage that will be updated

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-stage-from-class-to-online
Returns:

The updated stage

Type
Item

(static) changeStageFromOnlineToClass(stageItemId, token) → {Item}

Modifies the type of a stage from online to class

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage that will be updated

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-stage-from-online-to-class
Returns:

The updated stage

Type
Item

(static) changeStageToPath(stageItemId, token) → {Item}

Transforms a stage to a path. On the stage, all the path-related stuff will be removed (ie: supplier-related attributes). A new course module will be created using all the path's data.

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage that will be updated

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-stage-to-path
Returns:

The newly created stage

Type
Item

(static) changeTakersEnrollStatusForSupplier(newStatus, takerIds, syllabusItemId, stageItemId, editionItemId, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, testOnly, sendEmails, 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
newStatus string

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

takerIds Array.<string>

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

syllabusItemId string

Required: Syllabus's itemId

stageItemId string

Required: Stage's itemId

editionItemId string

Required: Edition's itemId

mailSenderId string

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

mailCC string

Optional: CC's of the mails

mailBCC string

Optional: BCC's of the mails

signatureId string

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

messageBodyAddOn string

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

textTemplateId string

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

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)

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-takers-enroll-status-for-supplier
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) changeUserStatusForEticket(userId, editionItemId, sendEmail, token) → {boolean}

Confirms the participation of a user to an edition. If an enroll already exists, only a new status will be created, otherwise a new enroll will be created. If the initiative requires a pre-registration, the new enroll's status won't be "confirmed" but "pre-registered". If all the edition's seats are already taken, the user will be set in a overbooking status (if enabled and some takes are still available), otherwise the confirmation won't be accepted. When a user is enrolled in overbooking status, his taker's type will be updated (or created, if missing) from CONSUMER to OVERBOOK. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionItemId string

Required: Edition's itemId

sendEmail boolean

Required: If true, an email will be sent to the user 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-user-status-for-eTicket
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) closeInitiativeForAdmin(stageItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a stage using its id

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

token string

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

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/close-initiative-for-admin
Returns:

The retrieved stage

Type
Item

(static) copyTakersToItem(sourceItemId, destinationItemId, sourceTakerStatus, token) → {number}

Copies the takers from an item to another. Only the takers directly connected to the source item will be copied:

  • if the source item is an edition => edition takers with itemId = sourceItemId and initiative takers with an enroll for the edition with itemId = sourceItemId
  • if the source item is an initiative => initiative takers with masterItemId = sourceItemId The remaining takers (initative takers without enrolls for the edition, public takers, group takers) won't be copied. It can also be specified a filter on the status of the takers to copy, ie: ItemTakerEnrollStatusTypes.USER_STATUS_INVITED => only the invited takers will be copied.
Parameters:
Name Type Description
sourceItemId string

Required: Id of the item that will be used as source for the takers to copy

destinationItemId string

Required: Id of the item to which the takers will be created

sourceTakerStatus string | Array.<string>

Optional: Status(es) type(s) used to filter on the statuses of the taker enrolls of the source item takers

token string

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

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

Counter of the copied takers

Type
number

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

Counts the initiatives that can be assigned to a path: they can't be associated to another path (they're "orphans") and they must be stages.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

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-available-initiatives-for-path
Returns:

Counter of the matching items

Type
number

(static) countAvailableSyllabuses(title, inCatalogOnly, attributeFilters, itemIds, token) → {number}

Counts the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

inCatalogOnly boolean

Optional: If true, only published syllabuses will be retrieved

attributeFilters boolean

Optional: A list of attributes to filter

itemIds string | Array.<string>

Optional: The list of item ids to filter

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-available-syllabuses
Returns:

Counter of the matching items

Type
number

(static) countCourseTakers(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-course-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) countLocations(title, token) → {number}

Counts the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

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-locations
Returns:

Counter of the matching items

Type
number

(static) countMaterialsForParent(title, parentId, materialType, token) → {number}

Retrieve the counter of the materials children for the given parents.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

parentId string

Required by the action: Specified whenever is required to create a session with Kaltura in the upload

materialType string

Optional by the action: The type of material (see ItemAttributeMaterialTypes)

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-materials-for-parent
Returns:

Array with the items that matches the given parameters

Type
number

(static) countTakerCourses(takerId, referenceType, referenceId, attributeFilters, token) → {number}

Retrieves the count of courses that have been assigned to a specific taker

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

Optional: Id of the taker for which courses will be retireved

referenceType string | Array.<string>

Optional: Type of the reference of the taker for which courses will be retireved

referenceId string | Array.<string>

Optional: Id of the reference of the taker for which courses will be retireved

attributeFilters Array.<{key: string, value: (string|Array.<string>)}>

Optional: Filter to apply to stages

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-taker-courses/:fromRecord/:numRecords
Returns:
Type
number

(static) countUsedTakesForPublic(userId, editionItemIds, token) → {MapById.<any>}

Retrieves the possibile actions that the user can do for the specified edition in the catalog (GLP's learning system)

Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionItemIds string

Required: Edition's itemIds

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-used-takes-for-public
Returns:

Object with all the possible actions that the user can do

Type
MapById.<any>

(static) countUserGoals(userId, token) → {Item}

Retrieves item goals of a user with only important data

Parameters:
Name Type Description
userId string

Required: the userId used to retrieve his goals

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-user-goals
Returns:

The retrieved stage

Type
Item

(static) countUserMaterialsForParent(title, parentId, materialType, token) → {number}

Retrieve the counter of the materials children for the given parents.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

parentId string

Required by the action: Specified whenever is required to create a session with Kaltura in the upload

materialType string

Optional by the action: The type of material (see ItemAttributeMaterialTypes)

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-user-materials-for-parent
Returns:

Array with the items that matches the given parameters

Type
number

(static) countUserTakersForEticket(editionItemIds, stageItemId, 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
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/count-user-takers-for-eTicket
Returns:

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

Type
Array.<ItemTakerWrapper>

(static) createCourseEdition(edition, days, stageItemId, courseModuleItemId, publishNow, token) → {Item}

Creates a new course edition for an initiative (stage/course)

Parameters:
Name Type Description
edition Item

Required: The new course edition to create

days Array.<Item>

Required (for "class" stages): The days of the course edition, there should be at least one. Every day must have the START_TIME and END_TIME attributes.

stageItemId string

Required: The id of the initiative

courseModuleItemId string

Required: The id of the course module to which the edition will be associated

publishNow boolean

Optional: If true, the created item will be immediatly published

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-course-edition
Returns:

The updated stage with all its children (course modules, editions and days)

Type
Item

(static) createCourseModule(courseModule, stageItemId, token) → {Item}

Creates a new course module

Parameters:
Name Type Description
courseModule Item

Required: The new course module to create

stageItemId string

Required: The itemId of the course module's stage

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-course-module
Returns:

The course module's stage with all its children loaded (included the newly created course module)

Type
Item

(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) createLocation(locaiton, token) → {Item}

Creates a new Location

Parameters:
Name Type Description
locaiton Item

Required: The location item object to persist

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-location
Returns:

The newly created location

Type
Item

(static) createPath(path, token) → {Item}

Creates a new path

Parameters:
Name Type Description
path Item

Required: The path object to persist

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-path
Returns:

The newly created path

Type
Item

(static) createStage(stage, pathItemId, token) → {Item}

Creates a new stage and if requested, it will be linked to the specified path

Parameters:
Name Type Description
stage Item

Required: The stage object to persist

pathItemId string

Optional: If present, the created stage will be assigned to the specified path

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-stage
Returns:

The newly created stage

Type
Item

(static) createSyllabus(syllabus, isClone, token) → {Item}

Creates a new syllabus

Parameters:
Name Type Description
syllabus Item

Required: The syllabus object to persist

isClone boolean

Optional: If true, it means that the syllabus is a clone of another one, so some checks will change (ie: public visibility in case of inclusion in catalog)

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-syllabus
Returns:

The newly created syllabus

Type
Item

(static) deleteCourseEdition(editionItemId, token) → {Item}

Deletes an edition and its course days

Parameters:
Name Type Description
editionItemId string

Required: The id of the edition item 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-course-edition
Returns:

Returns true if no errors were thrown during the execution

Type
Item

(static) deleteCourseItem(itemId, removeSyllabus, forcePathChildrenDeletion, token) → {void}

Deletes an item and all its children. By default, in case of course path deletion, the children won't be deleted.

Parameters:
Name Type Description
itemId string

Required: The id of the item to retrieve

removeSyllabus boolean

Optional: If true, the syllabus linked to the item will be deleted too, but only if it really is a syllabus and no other items extends it

forcePathChildrenDeletion boolean

Optional: If true, all the children will be deleted even for path 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-course-item/:itemId
Returns:

null

Type
void

(static) deleteCourseTakers(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-course-takers
Returns:

Return true if no errors were thrown during the execution

Type
boolean

(static) deleteTakerEnrolls(takerEnrollIds, token) → {boolean}

Deletes the specified taker enrolls

Parameters:
Name Type Description
takerEnrollIds Array.<string>

Required: Ids of the taker enrolls 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-taker-enrolls
Returns:

Return true if no errors were thrown during the execution

Type
boolean

(static) getCreditsCounterByTypeAndUserid(token) → {Array.<string>}

Retrieve the counter about the credits

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/get-credits-counter-by-type-and-userId
Returns:

The list of biennium

Type
Array.<string>

(static) getCreditsCounterByTypeAndUseridSplitted(limitYear, token) → {any}

Retrieve the counter about the credits splitted for any credit type

Parameters:
Name Type Description
limitYear number

Optional for the serice: The limit year to use in order to retrieve a passed biennium

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-credits-counter-by-type-and-userId-splitted
Returns:

An object with credits as labels: {ivass: 0, efaa: 0, efab: 0, mifid: 0, efp: 0}

Type
any

(static) getCurrentBiennium(limitYear, token) → {Array.<string>}

Retrieve the current biennium from the standard ivass biennium calculation

Parameters:
Name Type Description
limitYear number

Optional for the serice: The limit year to use in order to retrieve a passed biennium

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-current-biennium
Returns:

The list of biennium

Type
Array.<string>

(static) getDerogatedCoursesForSupplier(title, fromRecord, numRecords, allData, token) → {PaginationWrapper.<DerogatedCourse>}

Retrieves the courses which are derogated to the logged supplier

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items

fromRecord number

Required (if allData is false): Offset of the first record to retrieve

numRecords number

Required (if allData is false): Number of records to retrieve

allData boolean

Optional (if fromRecord and numRecords are defined): 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/get-derogated-courses-for-supplier
Returns:

Object with the total number of rows and the requested rows with the derogated courses information

Type
PaginationWrapper.<DerogatedCourse>

(static) getEditionAssessmentsForPublic(userId, editionItemId, token) → {Array.<Item>}

Retrieves the assessments referenced to an edition. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

editionItemId string

Required: The itemId of the edition for which the assessments 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/get-edition-assessments-for-public
Returns:

Array with the edition's assessments

Type
Array.<Item>

(static) getEditionForEticket(userId, stageItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a stage using its id. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

stageItemId string

Required: The itemId of the stage to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-edition-for-eTicket/:langCode/:itemId
Returns:

The retrieved stage

Type
Item

(static) getItemAttributeDescriptionForPublic(userId, itemId, attributeType, token) → {string}

Retrieves the description of the specified item attribute (for the user's lang) NB: This is a public method, no JWT token is expected

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

itemId string

Required: Item's id

attributeType string

Required: Item attribute's type for which the description 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/get-item-attribute-description-for-public
Returns:

The description of the specified item attribute, for the user's lang

Type
string

(static) getItemByIdForAdmin(itemId, withChildsLoaded, childsTreeDepth, isForLibraryItem, 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

childsTreeDepth number

Optional: depth in tree of childs to retrieve

isForLibraryItem string | boolean

Optional: check if it getting a library item

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-for-admin/:itemId
Returns:

The retrieved Item

Type
Item

(static) getItemByIdForSupplier(itemId, withChildsLoaded, childsTreeDepth, token) → {Item}

Get the details of an item (from Supplier) This service needs to be invoked by a Supplier Account

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

childsTreeDepth number

Optional: depth in tree of childs to retrieve

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-for-supplier/:itemId
Returns:

The retrieved Item

Type
Item

(static) getItemTitleByIdForPublic(userId, itemId, token) → {string}

Retrieves the title of an item using its id NB: This is a public method, no JWT token is expected

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

itemId string

Required: The itemId of the item for which the title 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/get-item-title-by-id-for-public
Returns:

The item's title

Type
string

(static) getLatestOpenedArchivedInitiative(title, itemTypes, fromRecord, numRecords, allData, token) → {PaginationWrapper.<Item>}

Retrieve the latest opened initiatives (created by the logged user) that are suspended (without any invited user)

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items

itemTypes Array.<string>

Optional: Types used to filter on the items, they have to be one of the available types defined in the local variable @see {AVAILABLE_ITEM_TYPES}

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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/get-latest-opened-archived-initiative/:fromRecord/:numRecords
Returns:

Items wrapped for pagination (with count)

Type
PaginationWrapper.<Item>

(static) getLatestOpenedInitiatives(fromRecord, numRecords, allData, token) → {PaginationWrapper.<Item>}

Retrieve the latest opened initiatives

Parameters:
Name Type Description
fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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/get-latest-opened-initiatives/:fromRecord/:numRecords
Returns:

Items wrapped for pagination (with count)

Type
PaginationWrapper.<Item>

(static) getLatestOpenedInProgressInitiatives(title, itemTypes, fromRecord, numRecords, allData, token) → {PaginationWrapper.<Item>}

Retrieve the latest opened initiatives (created by the logged user) that are in progress (with at least one invited user)

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items

itemTypes Array.<string>

Optional: Types used to filter on the items, they have to be one of the available types defined in the local variable @see {AVAILABLE_ITEM_TYPES}

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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/get-latest-opened-in-progress-initiatives/:fromRecord/:numRecords
Returns:

Items wrapped for pagination (with count)

Type
PaginationWrapper.<Item>

(static) getLatestOpenedSuspendedInitiatives(title, itemTypes, fromRecord, numRecords, allData, token) → {PaginationWrapper.<Item>}

Retrieve the latest opened initiatives (created by the logged user) that are suspended (without any invited user)

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items

itemTypes Array.<string>

Optional: Types used to filter on the items, they have to be one of the available types defined in the local variable @see {AVAILABLE_ITEM_TYPES}

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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/get-latest-opened-suspended-initiatives/:fromRecord/:numRecords
Returns:

Items wrapped for pagination (with count)

Type
PaginationWrapper.<Item>

(static) getLatestSupplierInitiatives(fromRecord, numRecords, allData, token) → {PaginationWrapper.<Item>}

Retrieve the latest opened initiatives

Parameters:
Name Type Description
fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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/get-latest-supplier-initiatives/:fromRecord/:numRecords
Returns:

Items wrapped for pagination (with count)

Type
PaginationWrapper.<Item>

(static) getPathFromIdForAdmin(pathItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a path using its id. The first level of its children (stages and course modules) will be loaded too.

Parameters:
Name Type Description
pathItemId string

Required: The itemId of the path to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-path-from-id-for-admin/:pathItemId
Returns:

The retrieved path

Type
Item

(static) getPathFromIdForPublic(userId, pathItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a path using its id. The first level of its children (stages and course modules) will be loaded too. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

pathItemId string

Required: The itemId of the path to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-path-from-id-for-public/:pathItemId
Returns:

The retrieved path

Type
Item

(static) getPathFromStage(stageItemId, token) → {Item}

Retrieves the path of a stage

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage for which the path 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/get-path-from-stage/:stageItemId
Returns:

The given stage's path

Type
Item

(static) getStageAnalytics(stageItemId, pathItemId, token) → {MapById.<StageAnalytics>}

Generates a set of analytics data for the specified stages (ie: total editions count, invited users count, etc).

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

Required (if pathItemId is null): Id(s) of the stage(s) to analyze

pathItemId string

Required (if stageItemId is null): Id of the path for which the associated stages will be retrieved and analyzed

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-stage-analytics
Returns:

Map with the stageItemId as key and a set of analytics data as value

Type
MapById.<StageAnalytics>

(static) getStageDefaultMailTemplates(itemType, token) → {Array.<ItemAttribute>}

Retrieves an array of item attributes with the default mail templates of a stage

Parameters:
Name Type Description
itemType string

Optional for the action: The item type to get a specific default set

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-stage-default-mail-templates
Returns:

The ItemAttributes with the default mail templates

Type
Array.<ItemAttribute>

(static) getStageFromIdForAdmin(stageItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a stage using its id

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-stage-from-id-for-admin/:stageItemId
Returns:

The retrieved stage

Type
Item

(static) getStageFromIdForPublic(userId, stageItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, isLibraryItem, itemAttributeTypesToResolve, token) → {Item}

Retrieves a stage using its id. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

stageItemId string

Required: The itemId of the stage to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

isLibraryItem boolean

Optional: If true, it will skip the check on 'stage'

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-stage-from-id-for-public/:stageItemId
Returns:

The retrieved stage

Type
Item

(static) getStageFromIdForSupplier(stageItemId, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Retrieves a stage using its id

Parameters:
Name Type Description
stageItemId string

Required: The itemId of the stage to retrieve

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-stage-from-id-for-supplier/:stageItemId
Returns:

The retrieved stage

Type
Item

(static) getSyllabusByIdForUser(itemId, withChildsLoaded, childsTreeDepth, originApplicationName, referenceApplicationName, attributeTypesToRetrieve, token) → {ConsumableItem}

Retrieves a Syllabus item with its completion status (referred to the logged user)

Parameters:
Name Type Description
itemId string

Required: The id of the item to retrieve

withChildsLoaded string | boolean

Optional: If true, the children items will be loaded into the itemChild.childObject field

childsTreeDepth number

Optional: Depth in tree of the childs to retrieve

originApplicationName string

Optional: the origin application name

referenceApplicationName string

Optional: the reference application name

attributeTypesToRetrieve string | Array.<string>

Optional: Types of the item attributes that must be retrive. By default only a small set of attributes will be retrieved, @see {ItemUtils.ItemSchemas.SEARCH_PAGE}.

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-syllabus-by-id-for-user
Returns:

The retrieved Item with the completion details

Type
ConsumableItem

(static) getTakeridsForStatus(editionItemId, takerStatus, token) → {Array.<string>}

Retrieves the ids of the takers of the specified edition. If a takerStatus is specified, only the takers which are in the given status will be retrieved.

Parameters:
Name Type Description
editionItemId string

Required: Id of the edition for which the statuses will be retrieved and counted

takerStatus string

Optional: Status type used to filter on the statuses of the taker enrolls

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-takerIds-for-status
Returns:

Array with the retrieved takerIds

Type
Array.<string>

(static) getUserCatalogActions(userId, editionItemId, token) → {UserCatalogActions}

Retrieves the possibile actions that the user can do for the specified edition in the catalog (GLP's learning system)



NB: This service is @deprecated, use @see {get-user-catalog-actions-for-editions} instead



Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionItemId string

Required: Edition's 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/get-user-catalog-actions
Returns:

Object with all the possible actions that the user can do

Type
UserCatalogActions

(static) getUserCatalogActionsForEditions(userId, editionIds, token) → {MapById.<UserCatalogActions>}

Retrieves the possibile actions that the user can do for the specified editions in the catalog (GLP's learning system)

Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionIds string | Array.<string>

Required: Editions 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/get-user-catalog-actions-for-editions
Returns:

Map with the edition's id as key and an object with all the possible actions that the user can do as value

Type
MapById.<UserCatalogActions>

(static) getUserGoals(userId, fromRecord, numRecords, allData, token) → {UserGoal}

Retrieves item goals of a user with only important data

Parameters:
Name Type Description
userId string

Required: the userId used to retrieve his goals

fromRecord number

Optional (if allData is true): Offset of the first record to retrieve

numRecords number

Optional (if allData is true): Number of records to retrieve

allData boolean

Optional (if fromRecord and numRecords are defined): 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/get-user-goals
Returns:

The retrieved stage

Type
UserGoal

(static) importPersonsAsCourseTakers(cidOrEmailList, userIdList, crossReferencesMap, inputRows, itemId, masterItemId, simulate, groupId, eventOptionalParams, doNotRaiseEvent, webinarUserRole, 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>

Required: The list of cids or emails of the users to import (optional if userIdList is passed)

userIdList Array.<string>

Required: The list of cids or emails of the users to import (optional if cidOrEmailList is passed)

crossReferencesMap MapById.<CrossReference>

Optional: A map with userId, cid or emal as the key (checked in this order) and reference data to fill the taker row

inputRows Array.<string>

Required: The list of cids or emails 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

groupId string

Required (mutually exclusive with masterItemId and itemId) groupId from witch to take users to import

eventOptionalParams MapById.<string>

Optional additional paramters to pass to the taker modification event

doNotRaiseEvent boolean

Optional: If true, the event ReferenceTypes.EVENT_TAKER_MODIFIED will not be raised

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)

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-course-takers
Returns:

Analytics data of the executed operations

Type
ImportPersonsAsTakersResponse

(static) importPersonsAsTakersForSupplier(cidOrEmailList, itemId, masterItemId, simulate, syllabusId, 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>

Required: The list of cids or emails 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

syllabusId string

Required: Id of the syllabus associated to the course, used to retrieve the mandatory training's IT9054 code

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-for-supplier
Returns:

Analytics data of the executed operations

Type
ImportPersonsAsTakersResponse

(static) isCoursePrivacyToAccept(userId, editionItemId, token) → {boolean}

Determines if a user must accept the course privacy or not. If he already has accepted the privacy, he doesn't need to accept it again. NB: This is a public method, no JWT token is expected

Parameters:
Name Type Description
userId string

Required: The id of the user that will be used to retrieve all the data

editionItemId string

Required: Edition's 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/is-course-privacy-to-accept
Returns:

True if the user must accept the course privacy, false if he doesn't need to or if he already has accepted it

Type
boolean

(static) listAvailableCourseLocationRooms(fullLocationText, searchedText, fromRecord, numRecords, allData, token) → {Array.<KeyValue.<Item>>}

Retrieves the available course location rooms. By default, it retrieves the first 25 records and orders them in ascendant order. The search can be filtered with the text speficied in the searchedText param, that match in "case-insensitive like" mode the room name.

Parameters:
Name Type Description
fullLocationText string

Required: Full location's address

searchedText string

Optional: String used to filter on the room name, used in "case-insensitive like" mode

fromRecord number

Optional: Offset of the first record to retrieve. The default value is 0.

numRecords number

Optional: Number of records to retrieve. The default value is 25.

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-available-course-location-rooms
Returns:

Array of KeyValue objects where the key is the room name and the value is the corresponding Place item

Type
Array.<KeyValue.<Item>>

(static) listAvailableCourseLocations(searchedText, fromRecord, numRecords, allData, token) → {Array.<string>}

Retrieves the available course locations full addresses. By default, it retrieves the first 25 records and orders them in ascendant order. The search can be filtered with the text speficied in the searchedText param, that match in "case-insensitive like" mode the addresses.

Parameters:
Name Type Description
searchedText string

Optional: String used to filter on the location full address, used in "case-insensitive like" mode

fromRecord number

Optional: Offset of the first record to retrieve. The default value is 0.

numRecords number

Optional: Number of records to retrieve. The default value is 25.

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-available-course-locations
Returns:

Array with the retrieved location addresses

Type
Array.<string>

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

Retrieve the initiatives that can be assigned to a path: they can't be associated to another path (they're "orphans") and they must be stages.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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-available-initiatives-for-path/:fromRecord/:numRecords
Returns:

Array with the items that matches the given parameters

Type
Array.<Item>

(static) listAvailableSyllabuses(title, withFullAttributesLoaded, itemAttributeTypesToResolve, fromRecord, numRecords, allData, inCatalogOnly, attributeFilters, itemIds, token) → {Array.<Item>}

Retrieve the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if withFullAttributesLoaded is true): The types of the attributes for which the cross-references will be resolved

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records will be retrieved

inCatalogOnly boolean

Optional: If true, only published syllabuses will be retrieved

attributeFilters boolean

Optional: A list of attributes to filter

itemIds string | Array.<string>

Optional: The list of item ids to filter

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-available-syllabuses
Returns:

Array with the items that matches the given parameters

Type
Array.<Item>

(static) listCourseTakers(editionItemIds, stageItemId, fromRecord, numRecords, allData, searchedText, token) → {Array.<EnrichedItemTaker>}

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

searchedText string

Optional: filter on taker names

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-course-takers/:fromRecord/:numRecords
Returns:

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

Type
Array.<EnrichedItemTaker>

(static) listItemAttributes(itemId, itemAttributeTypes, fromRecord, numRecords, allData, token) → {Array.<Item>}

Retrieve the items that are part of user activity

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

Required: The ids of the items

itemAttributeTypes string | Array.<string>

Required: the attributes types to retrive

fromRecord number

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

numRecords number

Required: The number of records to load

allData boolean

Optional: If true, all records 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-item-attributes
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) listItemsByAny(searchedText, techCompetences, softCompetences, argumentsTags, objectTypes, objectTypeSpecializations, languages, clusters, functionalAreas, adminTags, streamTags, levels, langs, originApplicationName, referenceApplicationName, referenceId, referenceType, techSkillsOnly, softSkillsOnly, fuzzySearch, sorting, fromRecord, numRecords, allData, token) → {Array.<Item>}

Retrieve the items that are part of user activity

Parameters:
Name Type Description
searchedText string

Required: The text provided by the user to start the search

techCompetences string | Array.<string>

Optional: Tags ids that user set as filters

softCompetences string | Array.<string>

Optional: Tags ids that user set as filters

argumentsTags string | Array.<string>

Optional: Tags ids that user set as filters

objectTypes string | Array.<string>

Optional: Type of objects that user set as filters

objectTypeSpecializations string | Array.<string>

Optional: Type of specialized objects that user set as filters

languages string | Array.<string>

Optional: Languages that user set as filters

clusters string | Array.<string>

Optional: Tags ids that user set as filters

functionalAreas string | Array.<string>

Optional: Tags ids that user set as filters

adminTags string | Array.<string>

Optional: Tags ids that user set as filters

streamTags string | Array.<string>

Optional: Tags ids that user set as filters

levels string | Array.<string>

Optional: Tags ids that user set as filters

langs string | Array.<string>

Optional: Tags ids that user set as langs

originApplicationName string

Optional for the action: Origin application name

referenceApplicationName string | Array.<string>

Optional for the action: If passed search only data from that referenceApplicationName

referenceId string | Array.<string>

Optional for the action: If passed search only data from that referenceId

referenceType string | Array.<string>

Optional for the action: If passed search only data from that referenceType

techSkillsOnly boolean

Optional: If set retrieve only specific type of items

softSkillsOnly boolean

Optional: If set retrieve only specific type of items

fuzzySearch string

Optional: If "N" (default) no fuzzy results will be included, if "Y" fuzzy results will be included, if "D" only fuzzy results will be returned (the delta: excluding results from standard search)

sorting string

Required: Param that specifies which type of sort will be used (S: score desc, D: create date desc, T: title asc). By default, the results will be ordered by title.

fromRecord number

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

numRecords number

Required: The number of records to load

allData boolean

Optional: If true, all records 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-items-by-any
Returns:

The Items list that match the search criteria

Type
Array.<Item>

(static) listLocations(title, withFullAttributesLoaded, itemAttributeTypesToResolve, fromRecord, numRecords, allData, token) → {Array.<Item>}

Retrieve the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if withFullAttributesLoaded is true): The types of the attributes for which the cross-references will be resolved

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records 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-locations
Returns:

Array with the items that matches the given parameters

Type
Array.<Item>

(static) listMaterialsForParent(title, fromRecord, numRecords, allData, parentId, materialType, initiativeId, token) → {Array.<Item>}

Retrieve the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records will be retrieved

parentId string

Required by the action: Specified whenever is required to create a session with Kaltura in the upload

materialType string

Required by the action: The type of material (see ItemAttributeMaterialTypes)

initiativeId string

Optional by the action: The id of initiative

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-materials-for-parent
Returns:

Array with the items that matches the given parameters

Type
Array.<Item>

(static) listNotInvitedTakers(editionItemIds, stageItemId, token) → {Array.<string>}

Retrieves the ids of the takers that aren't invited to the specified edition

Parameters:
Name Type Description
editionItemIds Array.<string>

Required: Ids of the items of the editions

stageItemId string

Optional: Id of the item of the stage. If present, it will be used to filter on the masterItedId field of the takers.

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-not-invited-takers
Returns:

Array of taker ids

Type
Array.<string>

(static) listNotNotifiedManagers(editionItemId, managerType, mailType, token) → {Array.<string>}

Retrieves the ids of the managers that haven't been notified yet for the validation of the users of an edition

Parameters:
Name Type Description
editionItemId string

Required: Id of the edition's item

managerType string

Required: Type of the managers to retrieve. The available types are defined in the ManagerTypes enum in the atfcore-commonclasses project

mailType string

Required: Mail's type to use for the check

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-not-notified-managers
Returns:

Array with the user ids of the managers

Type
Array.<string>

(static) listTakerCourses(takerId, referenceType, referenceId, attributeFilters, fromRecord, numRecords, allData, token) → {Array.<Item>}

Retrieves courses that have been assigned to a specific taker

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

Optional: Id of the taker for which courses will be retireved

referenceType string | Array.<string>

Optional: Type of the reference of the taker for which courses will be retireved

referenceId string | Array.<string>

Optional: Id of the reference of the taker for which courses will be retireved

attributeFilters Array.<{key: string, value: (string|Array.<string>)}>

Optional: Filter to apply to stages

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-taker-courses/:fromRecord/:numRecords
Returns:

Array of item that represent the stage with the extended object loaded (without any module, edition or day)

Type
Array.<Item>

(static) listTakerStatusesWithCount(editionItemId, token) → {Array.<KeyValue.<number>>}

Retrieves the statuses of the enrolls of an edition, with their respective count. A total counter will be added too (with status "ALL").

Parameters:
Name Type Description
editionItemId string

Required: Id of the edition for which the statuses will be retrieved and counted

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-taker-statuses-with-count
Returns:

Array of key-value pairs where the key is the enroll status type and the value is the counter of the associated enroll statuses. It will always contain at least one value (the "ALL" counter).

Type
Array.<KeyValue.<number>>

(static) listUserMaterialsForParent(title, fromRecord, numRecords, allData, parentId, materialType, token) → {Array.<ConsumableItem>}

Retrieve the syllabuses that can be used (ie: for concepts course creation). Only the confirmed syllabuses will be retrieved.

Parameters:
Name Type Description
title string

Optional: String used to filter on the title of the items (in "like" mode)

fromRecord number

Required (if allData is false): The number of the first record to load (exclusive - 0 to start from the first)

numRecords number

Required (if allData is false): The number of records to load

allData boolean

Optional: If true, all records will be retrieved

parentId string

Required by the action: Specified whenever is required to create a session with Kaltura in the upload

materialType string

Required by the action: The type of material (see ItemAttributeMaterialTypes)

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-materials-for-parent
Returns:

Array with the items that matches the given parameters

Type
Array.<ConsumableItem>

(static) listUserTakersForEticket(editionItemIds, stageItemId, fromRecord, numRecords, allData, token) → {Array.<UserForETicket>}

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-user-takers-for-eTicket/:langCode/:stageItemId/:editionItemId/:numRecords/:fromRecord
Returns:

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

Type
Array.<UserForETicket>

(static) listUserTakersForPublic(editionItemIds, stageItemId, 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
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-user-takers-for-public
Returns:

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

Type
Array.<ItemTakerWrapper>

(static) notifyAwardEarning(courseDateId, userId, awardScore, awardType)

Service that send a notification to the user for the course credits earning

Parameters:
Name Type Description
courseDateId courseDateId

The required course date id

userId userId

The required user id

awardScore awardScore

the required award score to notify

awardType awardType

the required award type

Returns:

(static) recalcUsersAwardsByCourse(stageId, creditType, startDate, endDate, theseUserIdsOnly, token)

Function that deletes (logically) and inserts again the specific credit type passed for all users of all editions of courses passed. To simplify and speed-up the process and because this service does not touch the presence/absence of persons in courses, it assumes that presence records in engagement table are valid and will be used to create new awards.

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

Required by the action: The courseId(s) of the course(s) to recalc

creditType string | Array.<string>

Required by the action: The credit type(s) to recalc

startDate Date

Optional for the action: If passed limits data using the operationDate (inclusive). Can be a date or an ISO string

endDate Date

Optional for the action: If passed limits data using the operationDate (inclusive). Can be a date or an ISO string

theseUserIdsOnly string | Array.<string>

Optionals for the action: If present operates only for this set of userIds ignoring all other person in courses

token string

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

Listens to Events:
  • event:HTTP POST /rest-api/corporateacademy-mediator/recalc-users-awards-by-course
Returns:

The result

(static) removeStageFromPath(stageItemId, pathItemId, token) → {Item}

Removes a stage from a path (so it will become an "orphan" stage that can be assigned to another path). If the stage isn't a child of the path, the service will return the path without modifying it.

Parameters:
Name Type Description
stageItemId string

Required: Id of the stage item to remove form the path's children

pathItemId string

Required: Id of the path item that will be modified

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-stage-from-path
Returns:

The updated path with all his children loaded

Type
Item

(static) updateCourseEdition(edition, days, stageItemId, publishNow, backToDraft, askForSupplierAvailability, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, sendNewCalendarsToConfirmedUsers, skipUpdateExistingDays, skipHistory, token) → {Item}

Updates a course edition of an initiative (stage/course)

Parameters:
Name Type Description
edition Item

Required: The updated course edition object

days Array.<Item>

Required (for "class" stages): The days of the course edition, there should be at least one. Every day must have the START_TIME and END_TIME attributes.

stageItemId string

Required: The id of the initiative

publishNow boolean

Optional: If true, the created item will be immediatly published

backToDraft boolean

Optional: If true, the edition's status will be set to DRAFT

askForSupplierAvailability boolean

Optional: If true, the supplier will be asked for its availability for the modified edition

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

sendNewCalendarsToConfirmedUsers boolean

Optional: If true, a new calendar will be send to confirmed users for each days of the updated edition

skipUpdateExistingDays boolean

Optional: If true, existing days won't be updated and only new ones will be created to speed-up operations and prevents massive and futile updates

skipHistory boolean

Optional: If true, the current version will not be persisted in item hostory tables (this should be used only when massive and repetitive updates have to be performed in a row).

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-course-edition
Returns:

The updated stage with all its children (course modules, editions and days)

Type
Item

(static) updateCourseEditionForSupplier(edition, days, stageItemId, publishNow, backToDraft, askForSupplierAvailability, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, skipUpdateExistingDays, skipHistory, token) → {Item}

Updates a course edition of an initiative (stage/course)

Parameters:
Name Type Description
edition Item

Required: The updated course edition object

days Array.<Item>

Required (for "class" stages): The days of the course edition, there should be at least one. Every day must have the START_TIME and END_TIME attributes.

stageItemId string

Required: The id of the initiative

publishNow boolean

Optional: If true, the created item will be immediatly published

backToDraft boolean

Optional: If true, the edition's status will be set to DRAFT

askForSupplierAvailability boolean

Optional: If true, the supplier will be asked for its availability for the modified edition

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

skipUpdateExistingDays boolean

Optional: If true, existing days won't be updated and only new ones will be created to speed-up operations and prevents massive and futile updates

skipHistory boolean

Optional: If true, the current version will not be persisted in item hostory tables (this should be used only when massive and repetitive updates have to be performed in a row).

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-course-edition-for-supplier
Returns:

The updated stage with all its children (course modules, editions and days)

Type
Item

(static) updateCourseModule(courseModule, stageItemId, token) → {Item}

Updates an existing course module

Parameters:
Name Type Description
courseModule Item

Required: The modified course module to update

stageItemId string

Required: The itemId of the course module's stage

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-course-module
Returns:

The updated course module

Type
Item

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

Update a Learning Plan

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-learning-plan
Returns:

The update Learning plan

Type
Item

(static) updateLocation(location, token) → {Item}

Updates a location

Parameters:
Name Type Description
location Item

Required: The location with the updates to apply

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-location
Returns:

The updated location

Type
Item

(static) updatePath(path, token) → {Item}

Updates a path

Parameters:
Name Type Description
path Item

Required: The path with the updates to apply

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-path
Returns:

The updated path

Type
Item

(static) updateStage(stage, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Updates a stage

Parameters:
Name Type Description
stage Item

Required: The stage with the updates to apply

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-stage
Returns:

The updated stage

Type
Item

(static) updateStageForSupplier(stage, withFullAttributesLoaded, withFullChildrenAttributesLoaded, itemAttributeTypesToResolve, token) → {Item}

Updates a stage

Parameters:
Name Type Description
stage Item

Required: The stage with the updates to apply

withFullAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute will be retrieved

withFullChildrenAttributesLoaded boolean

Optional: If true, the cross-referenced object of each attribute of each child will be retrieved

itemAttributeTypesToResolve Array.<string>

Optional (required if at least one withFullAttributes* param is true): The types of the attributes for which the cross-references will be resolved

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-stage-for-supplier
Returns:

The updated stage

Type
Item

(static) updateSyllabus(syllabus, token) → {Item}

Updates a syllabus

Parameters:
Name Type Description
syllabus Item

Required: The syllabus with the updates to apply

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-syllabus
Returns:

The updated syllabus

Type
Item

(static) updateSyllabusForSupplier(syllabus, token) → {Item}

Updates a syllabus (from Supplier) This service needs to be invoked by a Supplier Account

Parameters:
Name Type Description
syllabus Item

Required: The syllabus with the updates to apply

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-syllabus-for-supplier
Returns:

The updated syllabus

Type
Item

(static) userSelfCancel(userId, editionItemId, statusNote, sendEmail, token) → {boolean}

Cancels the participation of a user to an edition. If any users are in overbooking for that edition, one of them will be promoted to present. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionItemId string

Required: Edition's itemId

statusNote string

Optional: Note that will be set in the enroll status which represents the user cancellation

sendEmail boolean

Required: If true, an email will be sent to the user 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/user-self-cancel
Returns:

Returns true if no errors were thrown during the execution

Type
boolean

(static) userSelfConfirm(userId, editionItemId, sendEmail, usedTakes, coursePrivacyAccepted, token) → {boolean}

Confirms the participation of a user to an edition. If an enroll already exists, only a new status will be created, otherwise a new enroll will be created. If the initiative requires a pre-registration, the new enroll's status won't be "confirmed" but "pre-registered". If all the edition's seats are already taken, the user will be set in a overbooking status (if enabled and some takes are still available), otherwise the confirmation won't be accepted. When a user is enrolled in overbooking status, his taker's type will be updated (or created, if missing) from CONSUMER to OVERBOOK. NB: This is a public method, the visibilities of the specified user will be used to retrieve the items

Parameters:
Name Type Description
userId string

Required: Id of the user who wants to confirm his participation to an edition

editionItemId string

Required: Edition's itemId

sendEmail boolean

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

usedTakes number

Optional: Number of takes (aka seats) that will be used by the enroll, by default is 1

coursePrivacyAccepted boolean

Optional: True if the course privacy has been accepted by the user. NB: Not every user needs to accept that privacy.

token string

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

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

Returns true if no errors were thrown during the execution

Type
boolean