Pure1 REST API Postman Collection - Setup Guide
In order to use the Pure1 Postman collection, you must complete 3 main tasks:
- Generate a private/public RSA key pair
- Register your application in Pure1® Manage
- Configure your Postman environment and test authentication
Steps 1 and 2 are required only if you don't already have a Pure1 API Application ID and its related private key. If you already have one available, you may jump straight to step #3.
Generate a Private/Public RSA Key Pair
- On your computer, generate an RSA key pair. For instance, if you use the
openssl
tool on MacOs or Linux, please run the following command to generate a private key:openssl genrsa -aes256 -out pure1-test-private.pem 2048
- Generate the public key that corresponds to your private key with the following command:
openssl rsa -in pure1-test-private.pem -outform PEM -pubout -out pure1-test-public.pem
- Retrieve the text version of your public key with the following command:
cat pure1-test-public.pem
Register Your Application in Pure1 Manage
- Sign into Pure1 Manage (https://pure1.purestorage.com) with an administrator account.
NOTE: If your Pure1 account is not an administrative one, please contact Pure Technical Services to upgrade your account's privileges. - Navigate to the API Registration page available in the Administration section of the Pure1 Manage left navigation:
- Select Register Application on the API Registration page.
- A pop-up window will open, please enter the following:
- Name - Enter a name for your application.
- Public Key - Paste the output of the command you generated above in Generate a Private/Public RSA Key Pair including the BEGIN PUBLIC KEY and END PUBLIC KEY lines.
- Role - Select the appropriate role (admin has full permissions, read-only can only send GET requests.
- Press the Upload button to save.
Configure Your Postaman Environment and Test Authentication
Postman is a third-party utility for building and using API's. You can find more information here: https://www.postman.com/
- Generate the text version of your SSL private key by typing the following command:
openssl rsa -in pure1-test-private.pem -out private-key.txt
- Retrieve the text version of your public key with the following command:
cat private-key.txt
- Open the pure1_template environment in Postman.
NOTE: In order to see this template you will have had to downloaded the Pure1 Postman collection from Postmans’ API Network - Fill out the api_private_key_file environment variable with the output of the command in step #2 above.
- Retrieve the Application ID for your application in the API Registration page of Pure1 Manage and paste it into the api_client_name environment variable.
- In Postman, open the Authentication section of the Pure1 REST API collection.
- (First time only) Select the INIT: Load Crypto Library for RS256 request and send it to retrieve a necessary cryptographic library.
- Select the Get an OAuth token request and send it. If your private key and App ID have been correctly set up in Postman, you should receive a successful response with an access_token field.