Update User Type

Updates the user type to the given username.

URI PUT rest/v1/userType

Returns – A RequestResponse indicating success or failure.

Parameters

Name Type Description
encryptedToken string Required. Encrypted Token returned from client authentication. Returns null if token has expired or is invalid.
callerUsername string Required. The caller’s username.
targetUserId string Required. The User ID of the user to update its user type.
targetUserType string Required. Valid values are: Client Support, Group Support, User, Limited, Read-Only

Example – C#

string uri = “rest/v1/userType”;
string username = “The email of the user making the call”;
string targetUserId = “The GUID of the target user”;
string responseString = string.Empty;
JavaScriptSerializer jss = new JavaScriptSerializer();
RequestResponse response;

var data = new
{
targetUserId= targetUserId,
callerUsername= username,
targetUserType = “User”
};
string json = serializer.Serialize(data);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(host + uri);
request.Headers.Add(“Authorization” , encryptedToken);
request.Method = “PUT”;
request.ContentType = “application/json”;

using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
{
writer.Write(json);
}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();