diff --git a/Cisco Secure Access/PostmanExamples/Cisco Secure Access.postman_collection.json b/Cisco Secure Access/PostmanExamples/Cisco Secure Access.postman_collection.json index 450c39d..cc4a81b 100644 --- a/Cisco Secure Access/PostmanExamples/Cisco Secure Access.postman_collection.json +++ b/Cisco Secure Access/PostmanExamples/Cisco Secure Access.postman_collection.json @@ -11,6 +11,20 @@ "item": [ { "name": "Get Access Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const jsonResponse = pm.response.json();", + "pm.environment.set(\"AccessToken\", jsonResponse.access_token);", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], "request": { "auth": { "type": "basic", diff --git a/Cisco Secure Access/PostmanExamples/README.md b/Cisco Secure Access/PostmanExamples/README.md index c30b12f..e779fa9 100644 --- a/Cisco Secure Access/PostmanExamples/README.md +++ b/Cisco Secure Access/PostmanExamples/README.md @@ -20,7 +20,7 @@ ![image](https://user-images.githubusercontent.com/11685750/163173840-a9c399ae-929f-4891-b298-b9321a12f023.png) * Now generate an API access token: 1. Hit `Send` to generate a Cisco Secure Access API access token. - 1. Add your new access token token to the `AccessToken` variable in the `Cisco Secure Access` Postman environment. + 1. Your new access token should be automatically set in the `AccessToken` variable in the `Cisco Secure Access` Postman environment. **Note:** Cloud Security API access tokens are valid for up to one hour. Once a token expires, you can go back an generate a new access token and plug it into the environment as demonstrated above.