To update a user's profile in Virtual Private Cloud OnDemand, issue a PUT request for a specific user's ID.
All elements are required and omitting elements will cause an error. VMware recommends you issue a GET request to retrieve the user's profile, modify the profile, then submit the changes by sending a PUT request.
You can update the following elements for a user:
You cannot update the following attributes for a user:
■
| |
■
| |
■
| |
■
| |
■
| |
■
| |
■
|
■
|
You have signed up and registered for Virtual Private Cloud OnDemand and received an email with a user name and password for an Account Administrator. |
■
|
Using the URL in the confirmation email, you have logged in to Virtual Private Cloud OnDemand using the Web UI, set your password, and accepted the Terms of Service. |
■
|
You have logged in as an administrator and received an OAuth token. See Log In and Receive Access Token for information. |
1 | (Optional) Issue a request to get the ID and elements for the user that you want to update: GET https://vca.vmware.com/api/iam/Users In the request, include the OAuth token and the Accept header: Accept: application/json;version=5.7 Authorization: Bearer OAuth_token Include the OAuth token in all subsequent API requests as a request header. The returned response includes the list of users added for your account. |
2 | Issue the following request to update the user's profile: PUT https://vca.vmware.com/api/iam/Users/userId In the request, include the OAuth token and the Accept header: Accept: application/json;version=5.7 Authorization: Bearer OAuth_token In the request body, include the required elements for the user. See About User Management for a description of each element. |
This example shows how to request the profile of a specific user and update the values for familyName and roles. The elements and values returned in the GET userId response are provided and updated in the update user request body as follows:
■
| |
■
|
Request Header – Get userId 790ee208-6c7d-4177-b6c6-212bdbe1a66b
GET https://vca.vmware.com/api/iam/Users/790ee208-6c7d-4177-b6c6-212bdbe1a66b Accept: application/json;version=5.7 Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJiN2VjNjUyZi1mZmUzLTRh…
Response Body – Get userId 790ee208-6c7d-4177-b6c6-212bdbe1a66b
{"users":[ "meta": { "created":1402527010108, "modified":1402527010108 }, "schemas": [ "urn:scim:schemas:core:1.0" ], "state": "Active", "id": "790ee208-6c7d-4177-b6c6-212bdbe1a66b", "companyId": "e9b1f777-ab16-493d-a0af-ad3474e13cd2", "customerNumber": null, "email": "[email protected]", "familyName": "samplefamily1", "givenName": "Jane", "roles": { "roles": [ { "description": "Allows creation and management of VMs.", "name": "End User", "id": "6" } ] }, "serviceGroupIds": { "serviceGroupIds": [] }, "tosAcceptDate": null, "tosAccepted": false, "userName": "[email protected]" }
PUT https://vca.vmware.com/api/iam/Users/790ee208-6c7d-4177-b6c6-212bdbe1a66b Accept: application/json;version=5.7 Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJiN2VjNjUyZi1mZmUzLTRh…
{"users":[ "meta": { "created":1402527010108, "modified":1402527010108 }, "schemas": [ "urn:scim:schemas:core:1.0" ], "state": "Active", "id": "790ee208-6c7d-4177-b6c6-212bdbe1a66b", "companyId": "e9b1f777-ab16-493d-a0af-ad3474e13cd2", "customerNumber": null, "email": "[email protected]", "familyName": "newName", "givenName": "Jane", "roles": { "roles": [ { "description": "Allows creation and management of VMs.", "name": "Account Administrator", "id": "6" } ] }, "serviceGroupIds": { "serviceGroupIds": [] }, "tosAcceptDate": null, "tosAccepted": false, "userName": "[email protected]" }
Status: 204 NO CONTENT Connection: close Content-Length: 0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 06 Jun 2014 06:53:40 GMT Server: Apache-Coyote/1.1