Create a User
Applies To: Windows Azure Pack
Creates a user.
Request
Replace <ServiceMgmt> with your Service Management API endpoint address. . Replace <Port> with either 30005 for the tenant API or 30004 for the administrator API.
Method |
Request URI |
HTTP Version |
---|---|---|
POST |
https://<ServiceMgmt>:<Port>/users |
HTTP/1.1 |
URI Parameters
None.
Request Headers
The following table describes required and optional request headers.
Request header |
Description |
---|---|
Authorization: Bearer |
Required. Authorization bearer token. |
x-ms-principal-id |
Required. The principal identifier. |
x-ms-client-request-id |
Optional. The client request identifier. |
x-ms-client-session-id |
Optional. The client session identifier. |
x-ms-principal-liveid |
Optional. The principal Live identifier. |
Request Body
The following table describes the elements of the request body.
Element name |
Description |
---|---|
User |
The information used to create the user. For more information, see User (Common object). |
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
A successful operation returns status code 201 (Created).
For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).
Response Headers
The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
Response Body
The following table describes the key elements of the response body:
Element name |
Description |
---|---|
User |
The created User. For more information, see User (Common object). |
Example
The following code example shows a Create User request.
POST https://<Computer>:30004/users HTTP/1.1
Authorization: Bearer <token>
x-ms-client-request-id: 1557497f-2f4c-45b1-a42d-416fff7641a2-2013-06-27 21:15:30Z
x-ms-client-session-id: 9ff600b4-0c8b-4110-9eab-4228ce92aa4d
x-ms-principal-id: <COMPUTER>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <COMPUTER>\Administrator
Content-Type: application/json; charset=utf-8
Host: <Computer>:30004
Content-Length: 160
Expect: 100-continue
{
"Name": "aaa@bbb.com",
"Email": "aaa@bbb.com",
"State": 1,
"CreatedTime": "0001-01-01T00:00:00",
"SubscriptionCount": 0,
"ActivationSyncState": 0,
"LastErrorMessage": null
}
The following code example shows a Create User response.
{
"Name": "aaa@bbb.com",
"Email": "aaa@bbb.com",
"State": 1,
"CreatedTime": "2013-06-27T21:15:30.787",
"SubscriptionCount": 0,
"ActivationSyncState": 0,
"LastErrorMessage": null
}