Comment on page

One time play tokens for embed

Single use tokens for embedded tracks.
One time play tokens can be used along with our embed a track feature to offer the same functionality but in a more controlled and secure way.
See our docs page for a more detailed guide on embedded tracks.
A one time play token is valid for a single track play, before the tokens expiry time. Once the token has expired or been used it will no longer be valid and new token will need to be generated.
Multiple one time play tokens can be generated for a single track. Tokens are valid up to 24 hours after creation. If a token is not used within this period, it will be invalidated automatically.

Step 1: Generate a one time play token

To generate a one time play token a generateOneTimePlayToken mutation query will need to be made to our GraphQL API endpoint, further documentation for this endpoint can be found in our API reference.
Open a terminal and run the following curl example:
cat >query.json <<EOF
"query": "mutation {
curl -H "Authorization: Bearer YOUR_API_KEY" -X POST -d @query.json
⇨ Replace TRACK_ID with the ID of the track for which you would like to generate a token and YOUR_API_KEY with your API. See the docs for more about our GraphQL API and generating an API key.

Step 2: Build the embed URL
⇨ Replace :
  • TEAM with your team name.
  • TRACK_NAME with the name of the track for which you generated the one play token.
  • YOUR_GENERATED_TOKEN with the newly generated onetime token.

Step 3: Share or embed

  1. 1.
    You can now share the url to have the track opened in kiosk mode. Kiosk Mode is a direct link to a full-screen version of the embed.
  2. 2.
    Embed in an iframe by adding the following to your website:
    sandbox="allow-same-origin allow-scripts allow-popups allow-forms allow-modals"
    style="border: 0;">