API Actions: CreateUser
Request Syntax:
JSON
POST /api/CreateUser HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/json
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74
{
"username": "ApiUser",
"firstName": "API",
"lastName": "User",
"password": "a@#$hfgdU|asdf",
"email": "support@your_domain.com",
"isAdmin": true
}
XML
POST /api/CreateUser HTTP/1.1
Host: use.your.host.name:82
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Content-Type: application/xml
X-Amz-Date: 20171115T202130Z
Authorization: AWS4-HMAC-SHA256 Credential= UQOPWUVNBALABCABCABC/20171115/us-east-1/cloudbasic/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=995374189c189e8e68ed3de82c1764ca11971711fb5179eeab2b19edd883dd74
<?xml version="1.0" encoding="utf-8"?>
<CreateUserRequest>
<UserName>ApiUser</UserName>
<Firstname>API</Firstname>
<Lastname>User</Lastname>
<Password>a@#$hfgdU|asdf</Password>
<Email>your-user@yourdomain.com</Email>
<IsAdmin>true</IsAdmin>
</CreateUserRequest>
Request Parameters
| Parameter | Description | Required |
|---|---|---|
| A character string that represents a valid email address. Must be unique among all users. | Yes | |
| Type: String Default: None |
||
| UserName | The User Name that will be used when trying to login to the CloudBasic console. Must be unique among all users. | Yes |
| Type: String Default: None |
||
| FirstName | The First Name of the user that is being created. | Yes |
| Type: String Default: None |
||
| LastName | The Last Name of the user that is being created. | Yes |
| Type: String Default: None |
||
| Password | The password that will be used when trying to login to the CloudBasic console. | Yes |
| Type: String Default: None |
||
| IsAdmin | Indicates whether the user will be granted administrative privileges or not. | No |
| Type: String Default: false Valid value: true/ false |
Request Headers
This implementation uses only request headers that are common to all operations. For more information please see the section Common Request Headers
Response Syntax:
JSON
HTTP/1.1 200
status: 200
{
"username": "ApiUser",
"firstName": "Api",
"lastName": "User",
"isAdmin": true
"publicKey": "XXXXXAWGNEOAQGQTETT",
"privateKey": "XXXXXWkJ53rCH/AAOEaIZDXWnVk3eYy0rcC5gOQ",
}
XML
HTTP/1.1 200 status: 200 <?xml version="1.0" encoding="utf-8"?> <CreateUserResponse> <UserName>ApiUser</UserName> <Firstname>Api</Firstname> <Lastname>User</Lastname> <IsAdmin>true</IsAdmin> <PublicKey>XXXXXQOCKWECPTYESPRL</PublicKey> <PrivateKey>XXXXXKJPOdDZ16Q1iK4oZvoQnTwUtOOcZWRmPdTD</PrivateKey> </CreateUserResponse>
Response Parameters
| Parameter | Description | Optional |
|---|---|---|
| UserName | The User Name of the user that was just created. | No |
| FirstName | The First Name of the user that was just created. | No |
| LastName | The Last Name of the user that was just created. | No |
| IsAdmin | true/ false. Indicates whether the user was granted administrative privileges. | No |
| PublicKey | This is the Public Key required to authenticate requests to the CloudBasic API. The API Access Key associated with this user will be returned only if the request contains <IsAdmin>true</IsAdmin>. For more information please see the section API Security Attention: This is the only time this value will be returned by the API. There are no other ways to retrieve this value. |
No |
| PrivateKey | This is the Private Key required to authenticate requests to the CloudBasic API. For more information please see the section API Security Attention: This is the only time this value will be returned by the API. There are no other ways to retrieve this value. |
No |
Error Response Syntax:
JSON
HTTP/1.1 400
status: 400
{
"errors": [
"{Username}:Invalid value for Username",
"{FirstName}:Invalid value for FirstName"
],
"requestId": 20
}
XML
HTTP/1.1 400
status: 400
<?xml version="1.0" encoding="utf-8"?>
<ErrorResponse>
<RequestId>request-id</RequestId>
<Errors>
<Error> {UserName}:Invalid value for UserName </Error>
<Error> {FirstName}:Invalid value for FirstName </Error>
</Errors>
</ErrorResponse>
