Getting Started with Postman for Working with VMware Cloud APIs

Postman is a great tool for getting started in developing APIs or working with existing APIs.  VMware Cloud users can choose to leverage REST based APIs in order to provision and manage all aspects of VMware Cloud on AWS, Software Defined Data Center (SDDC), NSX configuration, and more.  I wanted to write my steps to get started and dive into the authentication structure to generate an access token as a building block for future posts.  To follow along, download and install Postman, or work in the web UI.

Setup an Environment

a. Click on “Environments” and the “+” button

b.  Name the environment

c.  Add the following variables:

Variable type Current Value (Example) Where can I Find This
refresh_token
secret
sJsUXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXk_XXXXXXXXXXXXXXX-_XXXXXX2j
access_token
secret
leave blank
na

d.  Click “Save”

Environment Setup

Setup a Collection

a.  Click on the “Authorization” Tab in the collection
b.  Set the authorization method type to API Key
c.  Set a key to csp-auth-token
d.  Set the value to {{access-token}}
note that this will use the variable defined in the environment we created in step “c” in Setup an Environment above
e.  Click save

Creating the Login Request

a.  I built an example with the required parameters in this post in case more detail is needed.
b.  Add a request to the collection
c.  Set the request type to POST
d.  Set the request url to https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize
e.  In the body of the request, set the type to form-data
f.  Set a key to refresh_token
g.  Set the value {{refresh_token}}
h.  Click Save

Now we can validate the login request, which I have documented in the next post.