/token EndpointThe /token endpoint in the Podcast Performance Server is used to generate a Podcast Performance Admin Token. This document provides a step-by-step guide on how to use this endpoint.
/tokenX-PUB-KEY (required)PERFORMANCE_SECRET_KEY environment variable is set on your server in the .env. file.curl --location --request GET 'http://localhost:7000/token' \
--header 'x-pub-key: your-public-key' \
The response will be a JSON object containing the following property:
token: The generated Podcast Performance 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"
}
The /token endpoint performs the following tasks:
PERFORMANCE_SECRET_KEY environment variable is configured in your .env file.By following this guide, you should be able to successfully generate a Podcast Performance Admin Token using the /token endpoint.