API Actions: AlterUser

API Actions: AlterUser


Request Syntax:

XML

POST /api/AlterUser 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"?>
<AlterUserRequest>
	<Email>your-user@yourdomain.com</Email>
	<UserName>user-name</UserName>
	<Firstname>first-name</Firstname>
	<Lastname>last-name</Lastname>
	<IsAdmin>true</IsAdmin>
	<RecreateAccessKey>true</RecreateAccessKey>
</AlterUserRequest>

JSON

POST /api/AlterUser 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
 
{
	"email": "admin2@test.org",
	"username": "admin2",
	"password": "test",
	"firstName": "John",
	"lastName": "Doll Jr.",
	"isAdmin": true,
	"recreateAccessKey": true
}

 

Request Parameters

Parameter Description Required
Email A character string that represents a valid email address. Must be unique among all users. No*
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 being changed. No*
Type: String
Default: None
LastName The Last Name of the user being changed. No*
Type: String
Default: None
IsAdmin Indicates whether the user will be granted administrative privileges or not. No*
Type: String
Default: None
Valid value: true/ false
RecreateAccessKey Indicates whether to generate a new Access Keys pair. No*
Type: String
Default: None
Valid value: true/ false

*At least one Request Parameter is required.

Note:

(a) Depending on the intent of the request, at least one parameter must be provided. For example, when recycling Access Keys, pass only the <RecreateAccessKey>true</RecreateAccessKey> parameter.
(b) IsAdmin - API calls authenticated with the access key of any administrator can demote/promote users to non-admin/admin. If a user is being promoted to an admin, an API access key will be generated and returned in the response.
(c) RecreateAccessKey - Only API calls authenticated with the root [admin]'s access key, can request regeneration of other administrators’ API access keys. All other administrators can regenerate only their access keys for which the API call must be authenticated with the access key of the respective administrator.

 

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"?>
<AlterUserResponse>
	<UserName>admin2</UserName>
	<PublicKey>AHECKQOCKWECPTYESPRL</PublicKey>
	<PrivateKey>y04DIKJPOdDZ16Q1iK4oZvoQnTwUtOOcZWRmPdTD</PrivateKey>
</AlterUserResponse>

JSON

HTTP/1.1 200
status: 200

{
	"username": "admin2",
	"publicKey": "YRKCRCXXJBVSILACGBPN",
	"privateKey": "aPKoNLlZ2mmgyT5iwy9QxzehSWf8XT2Ip8xaNeT9"
}

 

Response Parameters

Note: The response parameters PublicKey and PrivateKey are included only when RecreateAccessKey was set True. Please keep in mind that all Admin users can recreate their own access keys, but only the root Admin can regenerate other users' keys.

Parameter Description Optional
UserName The User Name of the user for which the AccessKey is recycled/regenerated. No
PublicKey This is the Public 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
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
}