Returns information about a class. If the class doesn’t exist, it is created
    • 11 Oct 2024
    • 3 Minutes to read

    Returns information about a class. If the class doesn’t exist, it is created


    Article summary

    Get
    /GetOrCreateClass

    The GetOrCreateClass command returns information about a class. If the class doesn’t exist, it is created.

    Security
    API Key
    Header parameter nameapi_key

    All methods require an API key, which must be obtained from Skillable. This key is used by Skillable to validate your account. The key can be passed as an HTTP request header with the header name "api_key".

    Query parameters
    id
    stringRequired

    The unique identifier of the class, as represented in your organization.

    Example1223334444
    name
    stringRequired

    The name of the class.

    ExampleSample+Class
    start
    integer (int64) Required

    When the class starts (in Unix epoch time).

    Example1333267200
    end
    integer (int64) Required

    When the class ends (in Unix epoch time).

    Example1333299600
    expires
    integer (int64) Required

    When labs can no longer be associated with the class (in Unix epoch time).

    Example1335978000
    instructorId
    string

    The ID you use to identify the class instructor in your external system.

    Example65214
    instructorFirstName
    string

    The first name of the class instructor.

    ExampleDemo
    instructorLastName
    string

    The last name of the class instructor.

    ExampleInstructor
    maxActiveLabInstances
    integer (int32)

    The maximum number of active lab instances than can exist concurrently within this class context. This is optional in most situations. However, it is required for classes that host shared environments. If a shared lab is launched against a class that doesn't have this value set, the launch will fail.

    Example20
    AvailableLabs
    array of integer

    An optional array of lab profile IDs. When provided, Skillable will know that these labs are available within the class. You do not need to set this value in order to launch labs against the class. This is useful when using Skillable to display a class attendance page, or when consuming shared class environments and you want the shared environment launch link to appear on the class monitor page.

    Example[ "17390", "17432" ]
    Responses
    200

    OK Response.

    Example of creating a class
    {
      "Id": "4449999",
      "Name": "Sample Class",
      "Start": 1333267200,
      "StartTime": "/Date(1333267200000)/",
      "End": 1333299600,
      "EndTime": "/Date(1333299600000)/",
      "Expires": 1335978000,
      "ExpiresTime": "/Date(1335978000000)/",
      "Instructor": null,
      "Url": null,
      "MaxActiveLabInstances": null,
      "AvailableLabs": [
        "17390",
        "17432"
      ],
      "Status": 1,
      "Error": null
    }
    Example of retrieving information on an existing class
    {
      "Id": "4449999",
      "Name": "Sample Class",
      "Start": 1333267200,
      "StartTime": "/Date(1333267200000)/",
      "End": 1333299600,
      "EndTime": "/Date(1333299600000)/",
      "Expires": 1335978000,
      "ExpiresTime": "/Date(1335978000000)/",
      "Instructor": {
        "Id": "65214",
        "FirstName": "Demo",
        "LastName": "Instructor"
      },
      "Url": null,
      "MaxActiveLabInstances": null,
      "AvailableLabs": [
        "17390",
        "17432"
      ],
      "Status": 1,
      "Error": null
    }
    Expand All
    object
    Id
    string

    The unique identifier of the class, as represented in your organization.

    Name
    string

    The name of the class.

    Start
    integer (int64)

    When the class starts (in Unix epoch time).

    StartTime
    string

    When the class starts (in Unix epoch time).

    End
    integer (int64)

    When the class ends (in Unix epoch time).

    EndTime
    string

    When the class ends (in Unix epoch time).

    Expires
    integer (int64)

    When labs can no longer be associated with the class (in Unix epoch time).

    ExpiresTime
    string

    When labs can no longer be associated with the class (in Unix epoch time).

    Instructor
    object | null
    Id
    string

    The ID of the class instructor in your external system.

    FirstName
    string

    The first name of the class instructor.

    LastName
    string

    The last name of the class instructor.

    Url
    string | null

    This response property is deprecated. Unless explicitly allowed by Skillable, this field will always be null. To obtain a class URL, use the ClassAccessUrl API command.

    MaxActiveLabInstances
    integer (int32) | null

    The maximum number of active lab instances than can exist concurrently within this class context.

    AvailableLabs
    Array of integer

    The IDs of labs available for launch within the class when using the class attendance UI directly in Skillable (generally not used for class deliveries managed outside of Skillable).

    integer
    Status
    integer (int32)

    Indicates the status of the API request.
    0 = Error
    1 = Success

    Error
    string | null

    In the event of an error, this will contain a detailed error message.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.