This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
Authentication
Protegrity API Playground uses an API Key and a JWT token for request authorization. You will receive your unique API Key as part of the registration process. This section documents how to obtain a JWT token.
To confirm and activate your account you need to first set a new password, using the credentials received via email.
Note: Accounts that were not activated within 7 days will be deleted and required to re-register.
Watch the video below for step-by-step instructions on registering with Protegrity API Playground:
1 - Set Password
Note: This endpoint is for first-time users only. If you require a password update, head to the Change Password endpoint.
METHOD: POST
ENDPOINT: https://api.playground.protegrity.com/auth/change-password
DESCRIPTION:
Set your password and obtain a JWT token for request authentication. This is a dedicated endpoint for the users creating their password for the first time and requires the temporary password provided during the registration.
Password requirements: Your new password should be at least 8 characters long, include a special character, a lowercase letter, an uppercase letter, and a number.
SAMPLE REQUEST
curl --location 'https://api.playground.protegrity.com/auth/change-password' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "<USER_EMAIL>",
"temp_password": "<TEMP_PASSWORD>",
"new_password": "<NEW_PASSWORD>"
}'
SAMPLE RESPONSE
{
"statusCode": 201,
"message": "Password change successful",
"jwt_token": "eyJraWQiOiI4T2pkOXlCWnlhMGYyVnZxRmRTblowN1ZnUEp6SHpTWFY5XC9xWXhvVTJWMD0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI4NDU4ZDQ2OC02MDIxLTcwMzktMTYzZi0zZGU4ZDZjMGE1ODgiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29t"
}
2 - Login
Note: If you are logging in for the first time, start with the Set Password endpoint.
METHOD: POST
ENDPOINT: https://api.playground.protegrity.com/auth/login
DESCRIPTION:
Log in to the service using your API Key and password and obtain a JWT token for request authentication. A JWT token is valid for 24 hours. Run the endpoint again to request a new token.
SAMPLE REQUEST
cURL --location 'https://api.playground.protegrity.com/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "<USER_EMAIL>",
"password": "<USER_PASSWORD>"
}'
SAMPLE RESPONSE
{
"statusCode": 201,
"message": "Login successful",
"jwt_token": "eyJraWQiOiI4T2pkOXlCWnlhMGYyVnZxRmRTblowN1ZnUEp6SHpTWFY5XC9xWXhvVTJWMD0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI4NDU4ZDQ2OC02MDIxLTcwMzktMTYzZi0zZGU4ZDZjMGE1ODgiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29t"
}
3 - Change Password
Note: This endpoint is for returning users only. If you are changing your password for the first time, start with the Set Password endpoint.
METHOD: POST
ENDPOINT: https://api.playground.protegrity.com/auth/change-password
DESCRIPTION:
Change your password.
Password requirements: Your new password should be at least 8 characters long, include a special character, a lowercase letter, an uppercase letter, and a number.
SAMPLE REQUEST
curl --location 'https://api.playground.protegrity.com/auth/change-password' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "<USER_EMAIL>",
"old_password": "<OLD_PASSWORD>",
"new_password": "<NEW_PASSWORD>"
}'
SAMPLE RESPONSE
{
"statusCode": 201,
"message": "Password change successful"
}