Table of Contents
Obtaining API Tokens
Once registered you’ll find your API Tokens at the console.
- The Private Token is used for protected API requests like starting the server and managing podcasts.
- The Public Token is used to display widgets as the stream or podcasts player in your website.
API Requests Authentication
Authenticating Private Requests
To authenticate your private requests, provide your private token with the request.
For a GET endpoint request, simply append the token as a URL parameter:
curl -i \
-X GET \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
"https://hub.cloud.caster.fm/private/GET_ENDPOINT?token=PRIVATE_TOKEN"
For a POST endpoint request, include it with your POST data:
curl -i \
-H "Accept: application/json" \
-X POST \
-d "{token:PRIVATE_TOKEN}" \
"https://hub.cloud.caster.fm/private/POST_ENDPOINT"
Verifying The Private Token
You can verify a private token with a GET request to the following URL:
https://hub.cloud.caster.fm/private/checkToken?token=PRIVATE_TOKEN
curl -i \
-X GET \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
"https://hub.cloud.caster.fm/private/checkToken?token=PRIVATE_TOKEN"
If the provided private token is valid the HTTP status code will be 200 and the body will contain a JSON with the private and public token:
JSON
{
"public_token": "97824ed0-ee56-4d2c-ba29-efbcb76794c5",
"private_token": "a8ea3659-6989-494b-9e9a-142a5fb6f8f5"
}