/token Endpoint for Non-Admin TokenThe /token endpoint in the Podcast Performance Server is used to generate a Non-Admin Token. This token is essential for your podcast XML feed to generate user sessions to store Podcast Performance data, submit polls, Q&As, and use other tools. This document provides a step-by-step guide on how to use this endpoint.
/tokenexpiresIn (optional)PERFORMANCE_SECRET_KEY environment variable is set on your server in the .env file..env environment variable EXPIRES_IN will be used.curl --location --request GET 'http://localhost:7000/token' \
--data-urlencode 'expiresIn=2h'
curl --location --request GET 'http://localhost:7000/token' \
The response will be a JSON object containing the following property:
token: The generated Non-Admin Token.{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzIjoibHd1czh6NnAtZDYyNjBhN2RkYmIwODZlNCIsImQiOiIxIiwiYSI6dHJ1ZSwiaWF0IjoxNzE3MTY1OTE0LCJleHAiOjE3MTcxNjk1MTR9.eUTxAjLJ8NcP_I-mNgVAlUyQSJpSIuuQBNz6wDiYcXM"
}
The endpoint may return various HTTP status codes to indicate errors:
500 Internal Server Error: Secret key not configured or error generating the token.400 Bad Request: Invalid public key.{
"error": "Secret key not configured"
}
This Non-Admin Token is used in your podcast XML feed for the following purposes:
The /token endpoint performs the following tasks:
PERFORMANCE_SECRET_KEY environment variable is configured.By following this guide, you should be able to successfully generate a Non-Admin Token using the /token endpoint, which can be used in your podcast XML feed to generate user sessions, submit polls, Q&As, and utilize other tools.