POST /api/v3/sponsoredlinks

Returns a token which, when appended to a certain URL and followed, logs a user into an environment based on the parameters provided with the request. The link is valid for a limited time (default 1 day).

If the email value corresponds to an existing user’s email, and an environment and blueprint exist for this user that correspond to the environment and blueprint parameters provided in the request, then the link redirects to that existing environment. If no such environment exists for the user, a new environment is created when the link is followed and the environment is opened.

If the email does not correspond to an existing user, a new user is created. The link generates and connects to a new environment for the user, based on the parameters provided in the request.

POST /api/v3/sponsoredlinks

Request Payload

{
    "email": "CosmoSpears@cloudshare.com",
    "firstName": "Cosmo",
    "lastName": "Spears",
    "jobTitle": "manager",
    "phoneNumber": "032-3232454",
    "company": "cloudshare",
    "policyId": "POLs3J1NEAESn7ipYMwYq20Q2",
    "blueprintId": "BPitsTtiUS27hEsHcVZcZsxw2",
    "useLatestSnapshot": false,
    "expirationMinutes": 15,
    "inviterId": "VPBMIHcniyUwPCFmxXZIfqng2",
    "shouldAskForPassword": true,
    "regionId": "REKolD1-ab84YIxODeMGob9A2",
    "allowMultipleUsages": false,
    "disableEnvironmentAcceptedNotificationMail": false,
    "disableEnvironmentAcceptedMailToInvitationOwner": false
}

Parameters

email The user’s email address. This will be the environment owner’s email
firstName The user’s first name
lastName The user’s last name
jobTitle
optional
The user’s job title
phoneNumber
optional
The user’s phone number
company The user’s company
policyId The ID of the environment policy with which the user and environment will be associated.
blueprintId The ID of the blueprint on which to base the environment
useLatestSnapshot
optional
Boolean. Indicates whether to base the environment on the latest or default snapshot in the blueprint, if applicable.

  • true. Uses the latest snapshot in the blueprint (if the latest is not the same as the default).
  • false (default). Uses the default snapshot in the blueprint.
expirationMinutes
optional
The period of time, in minutes, for which the created link will be valid. If not provided, the default value is used. Default: 1440
inviterId
optional
The project member creating this invitation. If not provided, the id of the request caller will be used.
shouldAskForPassword
optional
Boolean. Indicates whether the new user should create a password on first access to the environment (true), or whether a random password should be generated (false). Default is true.
regionId
optional
The region in which to create the sponsored link. A list of available regions can be obtained from here. The default region is US East (Miami)
allowMultipleUsages
optional
If true, allows login using the returned ‘loginToken’ more than once for the duration specified by {expirationMinutes}. Default is false.
disableEnvironmentAcceptedNotificationMail
optional
Boolean. Indicates whether the new user should be sent an email notification after accepting the invitation.

  • true. A notification email is not sent to the invited user after the invitation is accepted.
  • false (default). A notification email is sent to the invited user after the invitation is accepted.
disableEnvironmentAcceptedMailToInvitationOwner
optional
Boolean. Indicates whether the owning project member (set by the {inviterId} parameter) should be sent an email notification after the invitation is accepted.

  • true. A notification email is not sent to the owning project member after the invitation is accepted.
  • false (default). A notification email is sent to the owning project member after the invitation is accepted.

Response Example

{
    "loginToken": "x7467hqyWI",
    "envId": null,
    "isLoginRequired": false
}

Response Property Notes

loginToken To invite a user to the environment, append this token to the following URL:
https://use.cloudshare.com/Ent/Login.mvc/SponsoredLogin?token=[loginToken].
envId The ID of the user’s environment. Initially null for a new user since the environment is not created until the new user accepts the invitation.