This request will generate a link which, when followed, will generate and connect to a new environment which will be based on the parameters provided with the request. The link will be valid for a short time (default 5 minutes).
If the userEmail 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 will redirect to this environment. If no such environment exists for the user, a new environment is created and the returned link will redirect to it.
If the user does not exist, a new user is created. The user will be part of the specified environment policy. An environment will be created for this new user, based on the parameters provided in the request, and a link to it will be returned.
Request URL
GET https://use.cloudshare.com/Api/v2/Admin/CreateSponsoredLink?userEmail=<email>&firstName=<firstname>&lastName=<lastname>&jobTitle=<jobtitle>&phoneNumber=<phone>&company=<company>&environmentPolicyId=<envpolicy>&blueprintId=<blueprint>&userLatestSnapshot=<latestsnap>&expirationTimeMinutes=<expiration>&inviterId=<inviter>&shouldAskForPassword=<askforpassword>&UserApiId=<id>&token=<token>×tamp=<time>&HMAC=<signature>
Parameters
userEmail | The email address of the new user |
firstName | The first name of the new user |
lastName | The last name of the new user |
jobTitleoptional | The new user’s job title. |
phoneNumberoptional | The new user’s phone number |
company | The new user’s company |
environmentPolicyId | An environment policy id to which the new user and environment will be associated. |
blueprintId | Blueprint id for the new environment |
useLatestSnapshotoptional | Flag indicating whether to use the latest or the default snapshot for the environment (if they exist). Default is false |
expirationTimeMinutesoptional | The period of time, in minutes, that the created link will be valid. If not provided, the default value will be used. |
inviterIdoptional | The user creating this invitation. If not provided, the id of the request caller will be used. |
shouldAskForPasswordoptional | Flag indicating whether the new user should create a password (on the first access to the environment) or have a random password generated.Default is True (user should create a new password) |
Response example
If the request is successful (status_code is 0x20000), the url to the environment is returned:
{ "data": { "envId": null, "loginRequired": false, "url": "https://use.cloudshare.com/Ent/Login.mvc/SponsoredLogin?token=0kr0DE0vy7" }, "remaining_api_calls": 99997, "status_additional_data": null, "status_code": "0x20000", "status_text": "Success" }
If the request is unsuccessful, a response similar to the following will be received:
{ "data": null, "remaining_api_calls": 99997, "status_additional_data": null, "status_code": "0x40406", "status_text": "Environment Policy or VendorUserProject not found" }
Other possible error responses in the status_code are:
0x50016 | ActionParametersAreMissing – missing parameters in the request |
0x50036 | ValidationFailed – one or more of the parameters was incorrect | 0x40406 | Environment Policy or VendorUserProject not found – the values provided for environment policy Id or inviter Id are not found |
0x40407 | UserProjectNotFound – the inviter id cannot be found, or the inviter (caller) cannot invite in his or anyone else’s name |
0x50027 | BlueprintNotSelected – the blueprint id cannot be found. |
0x50028 | MismatchInEnvironmentPolicy – the environment policy id doesn’t match your or the inviter’s organization (if it is not a generic environment). |