This article explains how to share a Site with a Cloud user by using the Cloud DB API.
Prerequisites
Before you send the API request, make sure you meet the following requirements:
Authenticate your Cloud user account: You must authenticate your user before making API calls. For instructions, see Cloud Authentication API.
Find your Cloud System ID: Locate the string value for your
{CloudSystemId}. For instructions, see Cloud Connect.
Endpoint
To share a System with a Cloud user, send a POST request to the following endpoint:
https://nxvms.com/cdb/systems/{CloudSystemId}/users
Replace {CloudSystemId} with your target Cloud Site ID.
Request parameters
Include a JSON payload in your request body with the following fields:
accountEmail(string, required): The email address of the Cloud account you want to share System access with.accessRole(string, required): The access role assigned to the user. Valid values arenone,disabled,custom,liveViewer,viewer,advancedViewer,localAdmin,cloudAdmin,maintenance,owner, andsystem.userRoleId(string): The VMS-specific user role ID. For Cloud requests, pass an opaque string to send to the VMS server.customPermissions(string): The VMS-specific permissions. For Cloud requests, pass an opaque string to send to the VMS server.isEnabled(boolean, required): The account status. Set totrueto enable the account orfalseto disable it.vmsUserId(string): The VMS-specific user ID.
Code example
The following Python example shows how to configure and send the POST request:
import requests
cloud_system_id = "76cce8ca-d7c5-4172-93da-7f9749eb1db6"
url = f"https://nxvms.com/cdb/systems/{cloud_system_id}/users"
payload = {
"accountEmail": "exampleuser@gmail.com",
"accessRole": "advancedViewer",
"userRoleId": "",
"customPermissions": "",
"isEnabled": True,
"vmsUserId": ""
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Next steps
After sending a successful request, the system sends an invitation email to the specified user:
Existing users: Receive an invitation email to access the shared Site.
New users: Receive an email with instructions to create a Cloud account before accessing the Site.
Comments
0 comments
Article is closed for comments.