VS Code Guide
The Protegrity API Playground offers an easy way to test Protegrity’s data protection features. It comes with a pre-configured HTTP requests file that can be used in Visual Studio Code with the REST Client extension.
This is an addendum to the Postman guide. Please read that blog post first to learn how to register and how to use the Protegrity API Playground.
Add the REST Client extension
Follow the official documentation on how to add the REST Client extension in Visual Studio Code.
Download the HTTP requests collection
The best way to start with the Protegrity Playground in Visual Studio Code is to use our preconfigured HTTP requests collection file: get it from our Downloads section and open it in Visual Studio Code.
Add your API Key
The HTTP request file starts with the definition of some variables.
@api_token = changeme
@api_url = api.playground.protegrity.com
@api_version = v1
@jwt_token = changeme
@api_auth = auth
These variables will be used to construct the Playground’s URI and populate your authentication information.
Change the @api_token
to the value you received in your welcome email.
You’ll get the jwt_token only after your first login.
Bonus: Renew your JWT Token automatically
Since the JWT token is only valid for 24 hours and changes with a following login here’s a tip how you can set it automatically after each login.
The first request in the file is the user login.
Add two lines to set the @jwt_token
variable after each execution of the login request like in the following example:
# @name User_Login
POST https://{{api_url}}/{{api_auth}}/login
Authorization: {{jwt_token}}
Content-Type: application/json
{
"email": "<YOUR_EMAIL>",
"password": "<YOUR_PASSWORD>"
}
###
@jwt_token = {{User_Login.response.body.jwt_token}}
Keep your eye on the updates
The API Playground is an evergreen project: we are rolling out updates and new features every couple of months.
Last modified January 15, 2025