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.
Step 1: 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
-
Now, generate the public key that corresponds to your private key by running 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
Step 2: Register your application in Pure1 Manage
- Sign in into Pure1 Manage at https://pure1.purestorage.com with an administrator account (if your Pure1 account is not an administrative one, please contact your Pure support team to upgrade your account’s privileges).
-
Navigate to the API Registration page available in the Administration section of the Pure1 Manage left navigation:
-
In the API Registration page, click the Register Application button.
-
In the pop-up window that opens, enter a name for your application (in the Name field) and paste the output of the command you ran in step #3 (including the BEGIN PUBLIC KEY and END PUBLIC KEY lines) in the Public Key field. Finish by selected the appropriate role (
admin
has full permissions,read-only
can only send GET requests) for your application and press the Upload button.
Step 3: Configure your Postman environment and test authentication
-
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
-
Assuming you have downloaded the Pure1 Postman collection from Postmans’ API Network, you should have a
pure1_template
environment available in Postman. Open thispure1_template
environment and fill out theapi_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.