API Actions: CreateUser

API Actions: CreateUser


Request Syntax:

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>
	<Email>your-user@yourdomain.com</Email>
	<UserName>user-name</UserName>
	<Firstname>first-name</Firstname>
	<Lastname>last-name</Lastname>
	<Password>sample-password</Password>
	<IsAdmin>true</IsAdmin>
</CreateUserRequest>

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": "admin2",
	"firstName": "John",
	"lastName": "Doll",
	"password": "a@#$hfgdU|asdf",
	"email": "admin2@test.org"
	"isAdmin": true
}

 

Request Parameters

Parameter Description Required
Email 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:

XML

HTTP/1.1 200
status: 200
 
<?xml version="1.0" encoding="utf-8"?>
<CreateUserResponse>
	<UserName>user-name</UserName>
	<Firstname>John</Firstname>
	<Lastname>Doll</Lastname>
	<IsAdmin>true</IsAdmin>
	<PublicKey>AHECKQOCKWECPTYESPRL</PublicKey>
	<PrivateKey>y04DIKJPOdDZ16Q1iK4oZvoQnTwUtOOcZWRmPdTD</PrivateKey>
</CreateUserResponse>

JSON

HTTP/1.1 200
status: 200

{
	"username": "admin2",
	"firstName": "John",
	"lastName": "Doll",
	"isAdmin": true
	"publicKey": "UYSRBXAWGNEOAQGQTETT",
	"privateKey": "d+0FpIWkJ53rCH/AAOEaIZDXWnVk3eYy0rcC5gOQ",
}

 

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:

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>

JSON

HTTP/1.1 400
status: 400

{
   "errors": [
       "{Username}:Invalid value for Username",
	   "{FirstName}:Invalid value for FirstName"
	],
	"requestId": 20
}