ProvisionUser
Activates and Deactivates the user belonging to the given SystemUserId.
URI PUT rest/v1/users/provisionUser
Returns – A UserResponse 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. |
systemUserId | string | Required. The System User Id for the user in hand. |
salt | string | Required. Any combination of text and numbers that was used to encrypt the plain text password into encryptedPassword. |
userStatus | string | Required. Valid values are: Active = 1, Inactive = 0 |
Example – C#
string uri = “rest/v1/users/provisionUser”;
string sysUserId = “The GUID for the user in hand”;
string salt = “test123”;
string responseString = string.Empty;
JavaScriptSerializer jss = new JavaScriptSerializer();
UserResponse userResponse;
var data = new
{
salt= salt,
systemUserId= sysUserId,
userStatus = 1
};
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();
userResponse = jss.Deserialize<UserResponse>(responseString);