Live session

Live session represents offline or online meeting that can be a part of the learning path. Live sessions are not a part of a learning path navigation, they don’t affect score and progress, but they can be used as a required condition to pass a training and achieve a certificate. Live sessions can be added to advanced learning path as a part of the live sessions bucket. A user who has an individual membership in the dedicated learning path can be registered to the only one live session in the bucket. Users can register to a live session that is added to the bucket with the open registration by themselves or they can be registered by users with the dedicated permission (Opigno administrator).

Use API to work with the live sessions

Opigno API provides several queries to retrieve the needed information and data structure to work with the live session.

Queries to retrieve live sessions and buckets information

You can use getLiveSession query to retrieve the information about the session by its ID:
query getLiveSession {
  getLiveSession(liveSessionId: 1) {
    id
    bucketId
    title
    description
    startDate
    endDate
    address
    url
    status
    cta {
      title
      actionId
      arguments {
        key
        value
      }
      metadata {
        key
        value
      }
    }  
  }
}
To get all live sessions that relate to one bucket, use getLiveSessions query. There are several arguments that can be used in this query:
ArgumentTypeDescriptionDefault
bucketIdIDRequired argument; ID of the bucket to get live sessions for.
statusLiveSessionStatus, possible options: - DISABLED - PUBLISHEDAllows to filter by the live session status. Disabled live sessions are not available for registration.
reverseBooleanAllows to change the order of the sorting to DESC.FALSE
sortKeyLiveSessionSortKey, possible options: - ID - STARTAllows to change the default sorting (by the start date).START
query getLiveSessions {
  getLiveSessions(bucketId: 1) {
    id
    startDate
    endDate
    address
    url
    status
    cta {
      title
      actionId
      arguments {
        key
        value
      }
      metadata {
        key
        value
      }
    }  
  }
}
As an alternative to this query, you can use getLiveSessionBucket query to retrieve the information about the bucket in addition to the list of sessions.
In getLiveSessionBucket query there is no possibility to sort live sessions.
query getLiveSessionBucket {
  getLiveSessionBucket(bucketId: 1) {
    id
    learningPathId
    title
    description
    type
    registration
    sessions {
      id
      startDate
      endDate
      address
      url
      status
      cta {
        title
        actionId
        arguments {
          key
          value
        }
        metadata {
          key
          value
        }
      }  
    }
    status
  }
}

Retrieve information about live sessions in context of the learning path

The list of the related live sessions can be accessed from the LearningPath object:
query learningPath {
  getLearningPath(lpId: 92) {
   liveActivities {
    type
    status
    relatedEntity {
      id
      bucketId
      title
      description
      startDate
      endDate
      address
      url
      status
      isBucketRequired
      cta {
        title
        actionId
        arguments {
          key
          value
        }
        metadata {
          key
          value
        }
      }  
    }
   }
  }
}
Or as an alternative getLiveSessionBuckets can be used if you need the list of related buckets. Here is the list of arguments that can be used:
ArgumentTypeDescriptionDefault
lpIdIDRequired argument; ID of the learning path to get buckets for.
statusLiveSessionStatus, possible options: - DISABLED - PUBLISHEDAllows to filter by the bucket status. Live sessions that relate to the disabled buckets are not available for registration.
reverseBooleanAllows to change the order of the sorting to DESC.FALSE
sortKeyLiveSessionBucketSortKeys, possible options: - ID - TITLEAllows to change the default sorting.TITLE
query getLiveSessionBuckets {
  getLiveSessionBuckets(lpId: 92) {
    id
    learningPathId
    title
    description
    type
    registration
    status
    sessions {
      id
      startDate
      endDate
      address
      url
      status
    }
  }
}

Registration to a live session

There are two available types of live session buckets:
  • Open - available for registration for all users who are enrolled to the related learning path;
  • Admin-signed - will be visible to a user only after registration by admin.
In both cases the same mutation registerToLiveSession is used.
ArgumentTypeDescription
liveSessionIdIDRequired argument; ID of the live session to register for.
userContextIdIDOptional; if set, the user with the given API context will be registered to the live session if it’s possible. Otherwise the current user will be registered (if possible).
mutation registerToLiveSession {
  registerToLiveSession(liveSessionId: 2, userContextId: 242) {
    errors
    response {
      id
      isAttended
      relatedLpId
    }
  }
}
In a response a created LiveSessionAttendance object will be returned.