The Delete User operation deletes the specified user object for the specified user ID.

Request

The Delete User request may be specified as follows. Replace <user-id> with your user ID

Method Request URI HTTP Version

DELETE

https://tenant-management.contoso.net/users/<user-id>

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes request headers.

Request Header Description

Authorization

Specifies the credentials for this request. The value of this header must be set Negotiate <token>.

Request Body

None

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header Description

None

None

Response Body

None.

Example

Delete user.

  Copy Code
public void DeleteUser(string tenantServiceEndpoint, string username)
{
	HttpClient httpClient = new HttpClient();
	httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("TenantPortal:" + ”password”)))));

	string subscriptionEndpoint = tenantServiceEndpoint + "users/" + username;
	var response = httpClient.DeleteAsync(subscriptionEndpoint);
	var resultsStr = response.Result.Content.ReadAsStringAsync().Result;
	Console.WriteLine(resultsStr + "\n Successfully deleted User");
}