POST /api/v3/class/sponsoredlink

Create a unique link that automatically logins a student to class, skipping the class login page.

Request Path

POST /api/v3/class/sponsoredlink

Request Payload Example

{
    "classId": "COHnzLnDC5vBE7QDkfjlFV-g2",
    "studentEmail": "student+001@cloudshare.com",
    "studentFirstName": "student",
    "studentLastName": "no. 001",
    "registrationInfo": {
        "company": "CloudShare Ltd.",
        "phone": "555-8734"
    },
    "preRegisterStudent": false
}

Parameters

classId The ID of the class
studentEmail The student email
studentFirstName The student first name
studentLastName The student last name
studentLastName The student last name
preRegisterStudent Optional. Default is false. Add a new student to the class now (at the time of the request).
Required if class is configured to only allow login for registered students.
registrationInfo.company Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.jobLevel Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.address1 Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.address2 Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.city Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.state Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.zipCode Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.country Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.phone Optional. Extra student information. Only used if required in the class’s project training settings.
registrationInfo.regCode Optional. Extra student information. Only used if required in the class’s project training settings.

Response Example

{
    "id": "abcde",
    "loginUrl": "https://use.cloudshare.com/Ent/Course.mvc/ClassSponsoredLink/abcde",
}

Parameters

id The unique identifier of the class sponsored link
loginUrl The unique URL to navigate to and login to the class

Notes

  • The URL effectively automates the process of logging in the class. This means that the login might fail if for example:

    • The class is not yet open.
    • preRegisterStudent=false or was not set and the class is fully booked at time of login.
    • preRegisterStudent=true and the class has a maximum student limitation and is already fully booked.
    • The class does not allow multiple environment activation and URL is used after an environment was already activated and expired.
  • Unfilled or null custom fields, those listed in the registrationInfo object, might cause the login URL to show the class login page in order to the user to fill those fields if they’re required in the class’s project training settings.

    This behavior can be overriden by checking the Disable forced registration for Class Sponsored Links in the class’s project training settings. With this checked even if the Class Sponsored Link wasn’t generated with a required custom field, the student will be logged in.

  • Concurrent requests that use the same class ID with preRegisterStudent=true might data-race and result in overbooking, thus exceeding the maximum student limit for the class.

    To ensure that the maximum student limit is enforced for the class, API requests must be received using a mutually exclusive method.

  • To disable a Class Sponsored Link see POST – /api/v3/class/disablesponsoredlink