CloudLabs REST API v2.7

Prev Next

CloudLabs REST API v2.7

CloudLabs provides hands-on lab environments for individual learners and organizations for events and workshops. CloudLabs REST API provides end points to create and manage your own labs and environments.

Following are the supported authentication methods:

  1. Authentication on behalf of Azure AD App (using client credentials).

  2. Authentication on behalf of Azure AD User (Azure AAD Authentication).

  3. Authentication on behalf of Azure AD User (OAuth 2.0 resource owner Password credentials Grant). Few entities associated with CloudLabs:

  4. Tenant: Partner/Customer who is authorized by Spektra Systems to create/manage labs in CloudLabs Portal.

  5. Lab: It can be a classroom/workshop with pre-configured template/subscription for lab environments.

  6. Attendee: End user who is going to use the lab environment.

  7. Deployment: Environment setup in Azure.

Before trying out our API, please make sure you have a valid apiURL, api-version, Ocp-Apim-SubscriptionKey, and data required for authentication.

Table of Contents

Authentication on behalf of Azure AD App 3

Get Tenants 4

Get Labs 4

Get Lab By Id 7

Add Deployments 9

Get Lab Summary 9

Add Attendee 10

Add Attendee (Anonymous) 12

Get Attendee Deployment 13

Launch Lab Environment 17

Get Attendees 18

Get Attendee List Report 19

Check Signup Availability 20

Modify Attendee Settings 20

Delete deployment 21

Create Activation Codes 22

Get Activation Codes 23

Schedule Start VM 24

Schedule Stop VM 25

Clone Lab 26

Get Cloud Accounts 27

Exceptions 30

Meta data – Attendee Status 31

Meta data – Deployment Status 31

Authentication on behalf of Azure AD App

Here Authentication is done in the context of an Azure AD App provided by Spektra Systems. This will be unique for a tenant. For accessing any of the endpoints mentioned in this document, you need to pass authorization token and Ocp-Apim-Subscription-Key in the Headers. Directory Id, Client Id, Client Secret and Scope will be shared by Spektra Systems.

GET  https://login.microsoftonline.com/{directoryId}/oauth2/v2.0/token Headers

Name

Value

Content-Type

application/x-www-form-urlencoded

Request Body

Name

Value

client_id

Use data provided by Spektra Systems

client_secret

Use data provided by Spektra Systems

scope

Use data provided by Spektra Systems

grant_type

client_credentials

Sample Response Status Code: 200 Body: JSON Object

{

"token_type": "Bearer", "expires_in": 3599,

"ext_expires_in": 3599,

"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InBpVmxsb1FEU01LeGgxbTJ5Z3FHU1ZkZ 0ZwQSIsImtpZCI6InBpVmxsb1FEU01LeGgxbTJ5Z3FHU1ZkZ0ZwQSJ9.eyJhdWQiOiJhcGk6Ly8wMGMwNjVkMi1jNmQwLTRhZm YtYjJjNy1kOTg2YzllN2Y3ZTAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9iYWQ1MmY2Mi0wOTU3LTQ3ZTEtYjA0 Ny04YTg3NzhlMjdiNjEvIiwiaWF0IjoxNTc3Nzc1MzA3LCJuYmYiOjE1Nzc3NzUzMDcsImV4cCI6MTU3Nzc3OTIwNywiYWlvIj oiNDJWZ1lPaDdIK2hkODRtWGVmN2JTLy91ZGpuSEFnQT0iLCJhcHBpZCI6ImY3ZTNhZDEyLTU4YmEtNGM2MC1iMjkxLWFkMWRl

NTQ3OWY2NiIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2JhZDUyZjYyLTA5NTctNDdlMS 1iMDQ3LThhODc3OGUyN2I2MS8iLCJvaWQiOiIwZWQxZWY5Yi03NTY0LTRiYmUtYWRiZC02MDVhNDY5ZWU5ZWMiLCJyb2xlcyI"

}

Get Tenants

This endpoint returns information (name, tenantId) about tenants associated with user/app from which request is originated. TenantId retrieved in the response is mandatory for all other requests.

GET {apiURL}/api/tenants URI Parameters

Name

In

Required

Type

Description

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"previousLink": null, "totalItems": 1, "value": [

{

"name": "Contoso",

"tenantId": "4a203453-4c37-4874-8c4b-96d865f8371a"

}

],

"nextLink": null

}

Get Labs

This endpoint returns all active labs associated with requested tenant. LabId in the response, can be used in all scenarios related to a lab.

GET {apiURL}/api/tenants/{tenantId}/labs URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labType

query

False

string

Accepted values: instructor-led, self-paced, demo

api-version

query

True

string

The API version to use for this operation.

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"previousLink": null, "totalItems": 2, "value": [

{

"name": "Azure Functions & Logic App Serverless", "labId": "8352c78d-5c1b-4527-9e0b-435a8ff884e1",

"labCode": "AZ001",

"labType": "demo",

"launchUrl": "https://cloudlabs-manage.azurewebsites.net/#/odl/8352c78d-5c1b-45279e0b-435a8ff884e1",

"description": "Test", "deploymentMaxIdleTime": "1H",

"usesRdp": false,

"status": "registration_open",

"approvalStatus": "registration_activation_code_required", "maxNumberOfAttendees": null,

"maxNumberOfRetake": "5", "expiryDate": "2019-12-31T00:00:00",

"ownerEmail": "akash@spektra.com", "allowPersonalEmailForRegistration": true, "allowAttendeeToDeleteEnvironment": false, "enableStandByDeployments": true, "regions": [

"West Central US"

],

"tags": [

"azure"

],

"jobRoles": [

"Application Developer", "Architects",

"Business Analyst"

],

"audiences": [

"Data Developer", "Enterprise Developer"

],

"topics": [

"Administration", "Application Innovation"

],

"levels": [

Headers

"Intermediate"

],

"products": [

"Apache Spark", "Application Gateway"

]

},

{

"name": "Migrating SQL Database to Azure", "labId": "c12d590c-95f2-42c8-bafe-1af312cf206d", "labCode": "sdktest",

"labType": "self-paced",

"launchUrl": "https://cloudlabs-dev.azurewebsites.net/#/launch/c12d590c-95f2-

42c8bafe-1af312cf206d",

"description": "Please sign-up to get access.", "deploymentMaxIdleTime": "1H",

"usesRdp": false,

"status": "registration_open", "approvalStatus": "registration_required", "maxNumberOfAttendees": null, "maxNumberOfRetake": "",

"expiryDate": "2019-12-31T00:00:00",

"ownerEmail": "akash.premaraj@spektrasystems.com", "allowPersonalEmailForRegistration": true, "allowAttendeeToDeleteEnvironment": false, "enableStandByDeployments": true,

"regions": [

"West Central US"

],

"tags": [

"azure"

],

"jobRoles": [],

"audiences": [],

"topics": [],

"levels": [],

"products": []

}

],

"nextLink": null

}

Get Lab By Id

This endpoint returns data specific to a lab.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId} URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

api-version

query

True

string

The API version to use for this operation.

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"name": "Azure Functions & Logic App Serverless", "labId": "8352c78d-5c1b-4527-9e0b-435a8ff884e1",

"labCode": "sdktest", "labType": "demo",

"launchUrl": "https://cloudlabs-manage.azurewebsites.net/#/odl/8352c78d-5c1b-45279e0b-435a8ff884e1",

"description": "Test", "deploymentMaxIdleTime": "1H",

"usesRdp": false,

"status": "registration_open",

"approvalStatus": "registration_activation_code_required", "maxNumberOfAttendees": null,

"maxNumberOfRetake": "5", "expiryDate": "2019-12-31T00:00:00",

"ownerEmail": "akash@spektra.com", "allowPersonalEmailForRegistration": true, "allowAttendeeToDeleteEnvironment": false, "enableStandByDeployments": true, "regions": [

"West Central US"

],

"tags": [

"azure"

],

"jobRoles": [

"Application Developer", "Architects",

"Business Analyst"

],

"audiences": [

"Data Developer", "Enterprise Developer"

],

"topics": [

"Administration", "Application Innovation"

],

"levels": [

"Intermediate"

Headers

],

"products": [

"Apache Spark", "Application Gateway"

]

}

Add Deployments

This can be used to create pre-created lab environments for attendees before the lab begins. Number of environments/deployments required needs to be mentioned in the request body.

POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/deployments URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

string

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

count

True

integer

Number of deployments to be deployed for lab

Sample Response

Status Code: 204 No Content Body:

Empty

Get Lab Summary

Before starting a lab, this endpoint can be used to check the lab deployment status, user count, etc. GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/summary

URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

api-version

query

True

string

The API version to use for this operation.

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"initiatedDeploymentCount": 1,

"standByDeploymentCount": 0

}

Add Attendee

This endpoint can be used to add an attendee to a lab.

POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

autoLaunch

query

False

bool

True if you want a deployment along with attendee registration

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Headers

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

String

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

firstName

True

string

first name of attendee

lastName

True

string

last name of attendee

email

True

string

email address of attendee

Sample Response Status Code: 200

Body: JSON Object

{

"attendeeId": "9a6c5f31-141a-4a19-921f-56ab091175ca",

"labLaunchURL": "https://cloudlabs-manage.azurewebsites.net/#/odl/c12d590c-95f2-42c8-bafe-1af312cf206d/9a6c5f31-141a-4a19-921f-56ab091175ca"

}

This launch URL can be given to attendee. Once this is viewed in a browser, attendee will get either a launch button (if environment is not launched previously) or deployment details/VM + Guide experience.

Add Attendee (Anonymous)

This endpoint can be used to add an anonymous attendee to a lab. Since the attendee’s name and email address are optional, the request body can be left empty. Once the launch URL is opened in a browser, the environment will launch automatically. This is supported only if the ODL approval type is configured with “Anonymous” approval type.

POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

autoLaunch

query

False

bool

True if you want a deployment along with attendee registration

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

String

Value: application/json

Request Body (JSON) Empty

Sample Response Status Code: 200

Body: JSON Object

{

"attendeeId": "9a6c5f31-141a-4a19-921f-56ab091175ca",

"labLaunchURL": "https://cloudlabs-manage.azurewebsites.net/#/odl/c12d590c-95f2-42c8-bafe-1af312cf206d/9a6c5f31-141a-4a19-921f-56ab091175ca"

}

Get Attendee Deployment

This can be used to get current deployment of an attendee. If the deployment status is not “Succeeded”, this endpoint needs to be called after some time, to get new status.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees/{attendeeId}/deployments URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

attendeeId

path

True

string

Id which uniquely identifies an attendee

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response (for VM only scenario) Status Code: 200

Body: JSON Object

{

“attendeeId”: “68141a-4a19-921f-56ab091175ca”

“userName”: “odl_user_141589@cloudlabsaioutlook.onmicrosoft.com”, “password”: “htzj01SBX*u3”,

“deploymentStatus”: “Succeeded”, “rdpOverHttpsURL”: “https://rdp-

141491o3qtnneegkgum.mscloudlabs.ai/guacamole/#/?userName=USERNAME&uri=rdp:%2F%2Fdemouser:d emopass$123@labvmrxo7 m6bgpwlri.eastus.cloudapp.azure.com:3389%2F%3Fsecurity%3Dany%26ignore-cert%3Dtrue%26disableaudio%3Dtrue”,

“labGuideURL”: null,

“labLaunchURL”: “https://manage.cloudlabs.ai/#/odl/acec4a96-62cc-404a-825aec7b34800745/445b7365-4589-4f2d-b925-ee399d3cb025”,

“servicePrincipalDisplayName”: “https://odl_user_sp_141911”,

“servicePrincipalApplicationId”: “c2f7349a-1a42-4651-b644-893b15515yui”, “servicePrincipalAppObjectId”: “f01642b0-aae9-49df-b06b-02f368ac1678”,

“servicePrincipalObjectId”: “f987fb27-1ecb-4b93-9152-5a94f6af9e0c”, “servicePrincipalKey”: “zerk69JMM*BR”,

“properties”: [], “resourceGroups”: [

{

“resourceGroupName”: “ODL-vm-141589”, “resourceGroupRegion”: “West US”,

“resourceGroupStatus”: “Succeeded”, “outputParameters”: [

“vmDNSName”: “labvmrxo7m6bgpwlri.eastus.cloudapp.azure.com”,

“vmUsername”: “demouser”, “vmPassword”: “demopass$123”

]

}

]

}

Sample Response (for VM + Git Document scenario) Status Code: 200

Body: JSON Object

{

“attendeeId”: “1341a-4a19-921f-56ab091175ca”

“userName”: “odl_user_97837@cloudlabsaioutlook.onmicrosoft.com”, “password”: “htzj01SBX*u3”,

“deploymentStatus”: “Succeeded”, “rdpOverHttpsURL”: “https://rdp-

141491o3qtnneegkgum.mscloudlabs.ai/guacamole/#/?userName=USERNAME&uri=rdp:%2F%2Fdemouser:d

emopass$123@labvmrxo7 m6bgpwlri.eastus.cloudapp.azure.com:3389%2F%3Fsecurity%3Dany%26ignore-cert%3Dtrue%26disableaudio%3Dtrue”,

“labGuideURL”: “https://manage.cloudlabs.ai/#/labguide/90da055c-6887-4dd5-aaff-698a7439e366/111b6e97-78fa-4771-bf33-f9f76587731”,

“labLaunchURL”: “https://manage.cloudlabs.ai/#/labenvironment/f334db39-1d40-4444-b3d5-81a0ea59edc7/777f570a-0ede-46a3-858d-ecf6545a0fb5”,

“servicePrincipalDisplayName”: null, “servicePrincipalApplicationId”: null, “servicePrincipalAppObjectId”: null, “servicePrincipalObjectId”: null,

“servicePrincipalKey”: null, “properties”: [], “resourceGroups”:

[

{

“resourceGroupName”: “ODL-vm-97837”, “resourceGroupRegion”: “West US”, “resourceGroupStatus”: “Succeeded”,

"signInLink":

"https://console.cloud.google.com/home/dashboard?project=clgcporg8-046", "signInProperty": "clgcporg8-046"

“outputParameters”: [

“vmDNSName”: “labvmrxo7m6bgpwlri.eastus.cloudapp.azure.com”,

“vmUsername”: “demouser”, “vmPassword”: “demopass$123”

]

}

]

}

Sample Response (for Git Document only scenario) Status Code: 200

Body: JSON Object

{

“attendeeId”: “78521a-4a19-921f-56ab091175ca”

“userName”: “odl_user_141000@cloudlabsaioutlook.onmicrosoft.com”, “password”: “htzj01SBX*u3”,

“deploymentStatus”: “Succeeded”, “rdpOverHttpsURL”: null,

“labGuideURL”: “https://manage.cloudlabs.ai/#/labguide/90da055c-6887-4dd5-aaff-

698a7439e366/111b6e97-78fa-4771-bf33-f9f76587731f”,

“labLaunchURL”: “https://manage.cloudlabs.ai/#/odl/acec4a96-62cc-404a-825aec7b34800745/445b7365-4589-4f2d-b925-ee399d3cb025”,

“servicePrincipalDisplayName”: null, “servicePrincipalApplicationId”: null, “servicePrincipalAppObjectId”: null, “servicePrincipalObjectId”: null,

“servicePrincipalKey”: null, “properties”: [], “resourceGroups”:

[

{

“resourceGroupName”: “ODL-vm-141000”, “resourceGroupRegion”: “West US”, “resourceGroupStatus”: “Succeeded”, “outputParameters”: []

}

]

}

Sample Response (if deployment is In-Progress) Status Code: 200

Body: JSON Object

{

“attendeeId”: “35321a-4a19-921f-56ab091175ca” “userName”: null,

“password”: null,

“deploymentStatus”: “In-Progress”, “rdpOverHttpsURL”: null, “labGuideURL”: null,

“labLaunchURL”: null,

“servicePrincipalDisplayName”: null, “servicePrincipalApplicationId”: null,

“servicePrincipalAppObjectId”: null, “servicePrincipalObjectId”: null,

“servicePrincipalKey”: null, “properties”: [],

“resourceGroups”: []

}

Sample Response (if deployment is Deleted) Status Code: 200

Body: JSON Object

{

“attendeeId”: “366441a-4a19-921f-56ab091175ca”

“userName”: “odl_user_141001@cloudlabsaioutlook.onmicrosoft.com”, “password”: “fasj01SBXreg3”,

“deploymentStatus”: “Deleted”, “rdpOverHttpsURL”: null, “labGuideURL”: null,

“labLaunchURL”: null,

“servicePrincipalDisplayName”: null, “servicePrincipalApplicationId”: null,

“servicePrincipalAppObjectId”: null, “servicePrincipalObjectId”: null,

“servicePrincipalKey”: null, “properties”: [], “resourceGroups”:

[

{

“resourceGroupName”: “ODL-vm-141001”, “resourceGroupRegion”: “West US”, “resourceGroupStatus”: “Deleted”,

“outputParameters”: []

}

]

}

Launch Lab Environment

This endpoint can be used to launch a lab environment. Note: No need to use this endpoint if it is already launched while using “Add Attendee” endpoint with auto launch.

POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees/{attendeeId} URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

attendeeId

path

True

string

Id which uniquely identifies an attendee

autoLaunch

query

False

bool

True if you want a deployment along with attendee registration

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

String

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

firstName

True

string

first name of attendee

lastName

True

string

last name of attendee

email

True

string

email address of attendee

Sample Response Status Code: 200 Body: JSON Object

*Same as “Get Attendee Deployment”

Get Attendees

This endpoint returns all attendees in a lab. Attendee in the response, can be used in all scenarios related to an attendee.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

email

query

False

string

email address of attendee. Only this attendee details will be included in the response

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"previousLink": null, "totalItems": 2, "value": [

{

"id": "a5744afc-5f54-4a80-9c2e-13997fc9de54", "firstName": "Akash",

"lastName": "P",

"email": "akash10@spektra.com", "status": "Deleted"

},

{

"id": "9a6c5f31-141a-4a19-921f-56ab091175ca",

"firstName": "Akash", "lastName": "P",

"email": "akash8@spektra.com", "status": "Registered"

},

],

"nextLink": null

}

Get Attendee List Report

This endpoint returns all attendees in a lab. Attendee in the response, can be used in all scenarios related to an attendee.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees/reports URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

email

query

False

string

Use the attendee's email address to filter the results.

cloudDeploymentId

query

False

string

Use the cloud deployment Id to filter the results.

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

"previousLink": null, "totalItems": 4, "value": [

{

"id": "e6a0d187-7807-475d-bc4f-ac8aab5e4991", "firstName": "Santhosh",

"lastName": "sr",

"email": "Santhosh.sr@spektrasystems.com", "status": "Succeeded", "cloudDeploymentId": 131930

},

{

"id": "eff22b9f-48f9-4e7f-b28d-09f8cab8c12c", "firstName": "Akash",

"lastName": "P",

"email": "akash8@spektra.com ", "status": "Deleted", "cloudDeploymentId": 131929

}

],

"nextLink": null

}

Check Signup Availability

Before adding an attendee or if attendee wants a retake, this endpoint can be used to check the signup availability.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/checkSignUpAvailability URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

email

query

True

string

Email address of attendee.

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response Status Code: 200 Body: JSON Object

{

canSignUp: true,

message: "This user did not register for the lab"

}

Modify Attendee Settings

This endpoint can be used to extend an attendee’s lab environment before it expires. Also, if attendee wants to retake the lab one more time, maxTakeCount can be increased by setting it to larger value.

PUT {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees /{attendeeId}/settings

URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

attendeeId

path

True

string

Id which uniquely identifies an attendee

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

string

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

maxDuration

False

integer

Duration in hours

maxTakeCount

False

integer

Maximum attempts an attendee can take

Sample Response Status Code: 200 Body: JSON Object

{

maxDuration: 6H, maxTakeCount: 1,

remainingDuration: 2H30M

}

Delete deployment

If an attendee’s lab environment needs to be deleted, this endpoint can be used by specifying tenantId, labId and attendeeId.

DELETE {apiURL}/api/tenants/{tenantId}/labs/{labId}/attendees /{attendeeId}/deployment URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

attendeeId

path

True

string

Id which uniquely identifies an attendee

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Sample Response

Status Code: 204 No Content Body: Empty

Create Activation Codes

This endpoint can be used to add an activation code to a lab.

POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/activationcodes URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Content-Type

string

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

Name

True

string

Name of the activation code.

Customer

True

string

Name of customer.

City

True

string

Name of the City.

Country

True

string

Name of the country.

ExpiryDate

True

string

Expiry date of the activation code.

Sample Response Status Code: 200 Body: JSON Object

{

"OperationType": null, "Status": "Success", "ErrorCode": null,

"ErrorMessage": null, "ErrorDetail": null, "Data": null,

"ErrorKey": null

}

Get Activation Codes

This endpoint returns all activation code in a lab.

GET {apiURL}/api/tenants/{tenantId}/labs/{labId}/activationcodes URI Parameter

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Sample Response Status Code: 200

Body: JSON Object {

"OperationType": null, "Status": "Success", "ErrorCode": null,

"ErrorMessage": null, "ErrorDetail": null, "Data": [

"CL001", "CL002"

],

"ErrorKey": null

}

Schedule Start VM

POST {{apiURL}}/api/tenants/{{tenantId}}/labs/{{labId}}/schedule/startVM

This endpoint can be used to schedule the start of all VM instances present in active deployments. URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-SubscriptionKey

string

Subscription key which provides access to this API. Found in your Profile.

Request Body (JSON)

{

"Timezone":"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", "ScheduledDate":"2024-05-10",

"ScheduledTime":1706, "ScheduleConfigId": 4

}

Sample Response Status Code: 200 Body: JSON Object

{

"OperationType": null, "Status": "Success", "ErrorCode": null,

"ErrorMessage": null, "ErrorDetail": null, "Data": null,

"ErrorKey": null

}

Schedule Stop VM

POST {{apiURL}}/api/tenants/{{tenantId}}/labs/{{labId}}/schedule/stopVM

This endpoint can be used to schedule the stop all VM instances present in active deployments. URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-SubscriptionKey

string

Subscription key which provides access to this API. Found in your Profile.

Request Body (JSON)

{

"Timezone":"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", "ScheduledDate":"2024-05-10",

"ScheduledTime":1706, "ScheduleConfigId":5c

}

Sample Response Status Code: 200 Body: JSON Object

{

"OperationType": null, "Status": "Success", "ErrorCode": null,

"ErrorMessage": null, "ErrorDetail": null, "Data": null,

"ErrorKey": null

}

Clone Lab

Use this endpoint to clone an existing lab. Add the reference or base ODL labId as the “labId” URI parameter. POST {apiURL}/api/tenants/{tenantId}/labs/{labId}/clone

URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

labId

path

True

string

Id which uniquely identifies a lab

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Content-Type

String

Value: application/json

Request Body (JSON)

Name

Required

Type

Description

title

True

string

Title of new odl which will be created after cloning.

Sample Response Status Code: 200

Body: JSON Object

{

"name": "Azure Functions & Logic App Serverless", "labId": "9a6c5f31-141a-4a19-921f-56ab091175ca"

}

The response object contains the ODL name and labId of the newly cloned ODL.

Get Cloud Accounts

This endpoint returns the AWS accounts of the requested tenant, each with its subscription group and the lab deployments on it (both active and deleted). Accounts with no deployments are also returned, unless a status or email filter is passed. The user or app behind the token must be an active partner admin of the tenant.

GET {apiURL}/api/tenants/{tenantId}/cloudAccounts?cloudPlatform=aws

URI Parameters

Name

In

Required

Type

Description

tenantId

path

True

string

Id which uniquely identifies a tenant

cloudPlatform

query

True

string

Accepted value: aws. Missing or any other value returns 400.

fromDate

query

False

string

Start date, format YYYY-MM-DD (UTC). Pass together with toDate. Returns deployments that ran at any time in the period: started on or before toDate and not deleted before fromDate. Both days are included.

toDate

query

False

string

End date, format YYYY-MM-DD (UTC). Pass together with fromDate. Must be on or after fromDate.

status

query

False

string

One or more deployment statuses, comma-separated (see Meta data – Deployment Status). Matches the deployment's current status. Use %20 for a space, e.g. Already%20Deleted.

email

query

False

string

Email address of attendee. Only this attendee's deployments will be included in the response. Use %2B for a + in the address.

accountType

query

False

string

One or more account types, comma-separated. Accepted values: Shared, Dedicated Subscription, Dedicated Tenant.

top

query

False

integer

Number of accounts per page. Default 20; 0 also means 20.

skip

query

False

integer

Number of accounts to skip. Default 0.

api-version

query

True

string

The API version to use for this operation.

Headers

Name

Type

Description

Authorization

string

OAuth 2.0 access token obtained from Cloud Labs OAuth2 V2. Supported grant types: Authorization code, Client credentials.

Ocp-Apim-Subscription-Key

string

Subscription key which provides access to this API. Found in your Profile.

Notes

  • Without fromDate and toDate, every deployment that is not deleted is returned, whatever its age, plus deployments deleted in the last 30 days.

  • Filters combine: a deployment must match all of them. With status or email, only accounts that have a matching deployment are returned.

  • Paging is by account. totalItems counts the matching accounts across all pages; nextLink and previousLink keep the same filters.

  • Accounts are sorted by name and deployments newest first. An AWS account in two subscription groups appears once per group.

  • If an attendee retried a failed deployment, the latest attempt is returned.

  • Text values (cloudPlatform, status, accountType) are not case-sensitive. Dates in the response are UTC, written without a Z, e.g. 2026-11-05T09:58:29.8.

Sample Response

Status Code: 200

Body: JSON Object

{

"previousLink":  null,

"totalItems":  33,

"value":  [

{

"accountId":  "100000000001",

"accountName":  "Contoso Lab 013",

"accountType":  "Dedicated Subscription",

"subscriptionGroupName":  "Sample Dedicated Group A",

"memberAccounts":  [],

"assignments":  [

{

"deploymentId":  143477,

"labName":  "Sample Lab 1",

"odlUserEmail":  "odl_user_187597",

"status":  "Deleted",

"statusBeforeDeletion":  "Succeeded",

"deletedOn":  "2026-11-05T09:58:29.8",

"accessEndsOn":  "2026-11-05T09:58:22.8630855",

"assignedUser":  {

"name":  "Sample User 1",

"email":  "user1@example.com"

}

}

]

},

{

"accountId":  "100000000003",

"accountName":  "Contoso Lab 038",

"accountType":  "Shared",

"subscriptionGroupName":  "Sample Shared Group C",

"memberAccounts":  [],

"assignments":  [

{

"deploymentId":  142617,

"labName":  "Sample Lab 3",

"odlUserEmail":  "odl_user_186710",

"status":  "Succeeded",

"statusBeforeDeletion":  null,

"deletedOn":  null,

"accessEndsOn":  null,

"assignedUser":  null

}

]

}

],

"nextLink":  "/api/tenants/{tenantId}/cloudAccounts?top=20&skip=20&cloudPlatform=aws"

}

Response Fields – each account in value

Name

Type

Description

accountId

string

AWS account ID (12 digits)

accountName

string

Account name as set up in CloudLabs

accountType

string

Shared, Dedicated Subscription or Dedicated Tenant

subscriptionGroupName

string

Subscription group the account belongs to

memberAccounts

array

Dedicated Tenant root account only: its member accounts, each with accountId and accountName. Empty for other account types

assignments

array

Deployments on this account, newest first. Empty when there are none

Response Fields – each deployment in assignments

Name

Type

Description

deploymentId

integer

Deployment Id, the same as the DID# column in the ODL users grid. Null only for old records with no deployment

labName

string

Lab title

odlUserEmail

string

ODL user created for the lab, e.g. odl_user_187597

status

string

Current status of the deployment (see Meta data – Deployment Status)

statusBeforeDeletion

string

Deleted deployments only: Succeeded, Failed, or Running (deleted while still deploying). Null when not deleted

deletedOn

datetime

When the deployment was deleted (UTC). Null when not deleted

accessEndsOn

datetime

When the attendee's access ends or ended (UTC)

assignedUser

object

The registered attendee, with name and email. Always null on Shared accounts; null when no attendee is registered or the attendee's data is anonymized

Error Responses

Status Code

Error Code

Error Message

When

400

CL0

Invalid cloudPlatform. Supported value: aws.

cloudPlatform missing or not aws

400

CL0

Pass both fromDate and toDate, or neither.

Only one date passed

400

CL0

fromDate must be on or before toDate.

Dates reversed

400

CL0

top and skip must be zero or more.

Negative top or skip

400

CL0

Unknown status: {value}

A status value not in the list

400

CL0

Unknown accountType: {value}

An accountType value not in the list

400

CL5020

No access token found

No Authorization header

400

CL5022

No claims found

Token invalid or expired

403

–

Empty body

The caller is not a partner admin of this tenant

Exceptions

Sample Response

Status Code: 400/401/403/404/500 Body: JSON Object

{

"correlationId": 637105246526361093", "errorCode": "CL5014",

"errorMessage": " Voucher code expired",

"detailedErrorMessage": " Voucher code expired"

}

List of error codes will be available at https://bit.ly/2J7U70D .

Meta data – Attendee Status

AttendeeStatus

Description

Registered

Attendee registered, but deployment is not associated

Failed

Deployment got failed

Deploying

Deployment is still deploying

Succeeded

Deployment is succeeded, and associated with attendee

Deleting

Deployment is deleting

Deleted

Deployment is deleted

Meta data – Deployment Status

DeploymentStatus

Description

Running

Deployment in progress

Succeeded

Lab deployed and live

Failed

Deployment failed and not deleted

Deleting

Deletion in progress (not deleted yet)

Deleted

Deployment is deleted. Also used when the deployment was deleted but the attendee's status was never updated. A deployment that failed and was then deleted is Deleted, with statusBeforeDeletion Failed

Already Deleted

Marked as already deleted

Cancelled

Registration cancelled

Also accepted in the status filter

Registered, Approved, Waitlist, Rejected, PaymentIssue, PaymentPending, Sent Invite, Initiated, Accepted, Awaiting policy assignment result, Policy failed after deployment succeeded, AD Account Created, Manual steps required, Awaiting for post deployment steps, Deployment Under Auto Heal