Payload
The payload is the object sent by I3HUB to the custom services when a session is to be started. This object contains information about the users selected for a session, which institution they belong to, the operator who is running the session and the activities to be started.
This object can be passed to the custom service in the frontend (within the localStorage) or in the backend (by posting to a defined endpoint). This allows for more flexibility in the development of services and for CSR and SSR applications.
Structure
The structure of the object is the following:
{
"payload": {
"currentOperator": { ... },
"currentInstitute": { ... },
"currentSubjects": [ ... ],
"currentActivities": [ ... ]
}
}
This information is used by the custom service to have, within its own database, references to these users and the sessions they run. It is therefore implicit that there is no "strong relationship" between the users and the sessions they run, but is based on the identifiers provided by i3hub.
Object properties
Eventually we want to add a mechanism to filter only the relevant information to the custom service, in order to avoid possible leak of user information
Institute
Below the institute object:
"currentInstitute": {
"id": "61e94b31-de23-4956-83fc-f02ef9c2471a",
"name": "Polimi",
"city": "Milano",
"address": "Via Golgi 39",
"image": "https://exquiro.it/wp-content/uploads/2021/05/Polimi-1.jpg",
"createdAt": "2021-10-06T06:14:58.753Z",
"updatedAt": "2021-10-06T06:14:58.753Z"
},
Subjects
Below the subjects array:
"currentSubjects": [
{
"id": "80ece083-dfcd-4232-a2df-5e35cb2364f6",
"name": "Marco",
"surname": "Rossi",
"email": null,
"birthdate": "1994-09-09T00:00:00.000Z",
"servicesConfiguration": {},
"gender": true,
"isAnonymous": false,
"image": "",
"createdAt": "2021-10-06T06:14:59.130Z",
"updatedAt": "2021-10-06T06:14:59.130Z",
"instituteId": "61e94b31-de23-4956-83fc-f02ef9c2471a"
}
],
Activities
Example of an activity array:
"currentActivities": [
{
"name": "mars.act1",
"description": "Registra la tua voce mentre ripeti l'audio",
"label": "Ripeti l'audio",
"image": "https://www.seekpng.com/png/detail/89-894494_colorful-music-note-png-music-notes-guitar-music.png",
"isPlaylist": false,
"isConfigurable": true,
"type": "live",
"manifest": {
"id": "/mars.activities.act1",
"type": "object",
"required": [
"audio"
],
"properties": {
"audio": {
"label": "Audio",
"description": "Audio da riprodurre",
"inputType": "select",
"type": "string",
"anyOf": [
{
"const": "stem_0_90",
"label": "Audio 0"
},
{
"const": "stem_1_90",
"label": "Audio 1"
},
{
"const": "stem_1_100",
"label": "Audio 2"
},
{
"const": "stem_2_90",
"label": "Audio 3"
},
{
"const": "stem_3_90",
"label": "Audio 4"
},
{
"const": "stem_4_90",
"label": "Audio 5"
},
{
"const": "stem_5_90",
"label": "Audio 6"
}
]
}
}
},
"configuration": {
"audio": [
"stem_0_90",
"stem_1_90"
]
}
}
]