Export the list of all vRA users through REST API
search cancel

Export the list of all vRA users through REST API

book

Article ID: 390971

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

The article list the steps for reference about how to export all vRA users by using REST API.

Environment

VMware Aria Automation 8.16.0

Resolution

  1. Generate access token for API authentication of Aria Automation by refer the KB Generate an Access Token and Bearer Token in VMware Aria Automation for API Authentication
  2. Obtain the 'org id' of the user who logged in:

    GET /csp/gateway/am/api/v2/loggedin/user/orgs

    curl -X 'GET' \
      'https://vra.example.com/csp/gateway/am/api/v2/loggedin/user/orgs?pageStart=1&pageLimit=200' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer #####'

    The API respond:

    {
      "results": [
        {
          "name": "####",
          "displayName": "####",
          "metadata": {
            "isMsp": "true"
          },
          "id": "########-####-####-####-############",
          "refLink": "/csp/gateway/am/api/orgs/########-####-####-####-############",
          "parentRefLink": null
        }
      ],
      "totalResults": 1
    }

  3. Get all user information under the 'org id':

    GET /csp/gateway/am/api/v2/orgs/{orgId}/users

    curl -X 'GET' \
      'https://vra.example.com/csp/gateway/am/api/v2/orgs/########-####-####-####-############/users?pageStart=1&pageLimit=200' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer #####'

    The API respond:

    {
      "results": [
        {
          "user": {
            "username": "admin",
            "firstName": "Local",
            "lastName": "Admin",
            "domain": "System Domain",
            "idpId": "########-####-####-####-############",
            "accessible": false,
            "acct": "admin",
            "email": "[email protected]",
            "userId": "########-####-####-####-############",
            "userProfile": null
          },
          "orgId": "########-####-####-####-############",
          "organizationRoles": [],
          "serviceRoles": []
        },
        ..........
      ],
      "totalResults": ####
    }

Additional Information