1. Home
  2. Docs
  3. API Documentation
  4. Authentication
  5. API Requests Authentication

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.api.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.api.caster.fm/private/POST_ENDPOINT" \

Invalid Token Response

If the private token provided is invalid an HTTP status code 401 will be returned


Verifying The Private Token

You can verify a private token with a GET request to the following URL:
https://hub.api.caster.fm/private/checkToken?token=PRIVATE_TOKEN

curl -i \
     -X GET \
     -H "Accept: application/json" \
     -H "Cache-Control: no-cache" \
     "https://hub.api.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:

{
  "public_token": "97824ed0-ee56-4d2c-ba29-efbcb76794c5",
  "private_token": "a8ea3659-6989-494b-9e9a-142a5fb6f8f5"
}

Invalid Token Response

If the private token provided is invalid an HTTP status code 401 will be returned

Was this article helpful to you? Yes 3 No