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:

givenName

familyName

state

name within the roles element

You can update the name to one of the following values: Account Administrator, Read-Only Administrator, End User, Virtual Infrastructure Administrator, Network Administrator .

Note

Role updates do not rely on IDs. Change the role name field. The API ignores any changes you make to the id or description attributes.

email

The API partially supports updating this element. Update the email element to change the address that VMware uses when sending Virtual Private Cloud OnDemand messages to the user.

Note

Updating the email element does not change the value for the userName element.

You cannot update the following attributes for a user:

userName

companyId

userId

tosAccepted

tosAcceptDate

Meta fields

Schema field

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.

Note

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.

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:

familyName updated from “samplefamily1” to “newName”

roles updated from End User to Account Administrator.

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…

Request body not required.

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": "test994@sample.com",
    "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": "test994@sample.com"
}

Request Header – Update user

PUT https://vca.vmware.com/api/iam/Users/790ee208-6c7d-4177-b6c6-212bdbe1a66b
Accept: application/json;version=5.7
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJiN2VjNjUyZi1mZmUzLTRh…

Request Body – Update user

{"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": "test994@sample.com",
    "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": "test994@sample.com"
}

Response Header – Update user

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

Response body not returned.