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.
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.
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.GraphQL API
Open a terminal and run the following curl example:
cat >query.json <<EOF
{
"query": "mutation {
generateOneTimePlayToken(trackID:\"TRACK_ID\")
}"
}
EOF
curl -H "Authorization: Bearer YOUR_API_KEY" -X POST -d @query.json https://play.instruqt.com/graphql
⇨ 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.https://play.instruqt.com/embed/TEAM/tracks/TRACK_NAME?token=YOUR_GENERATED_TOKEN
⇨ 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.
- 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.Embed in an
iframe
by adding the following to your website:<iframewidth="1140"height="640"sandbox="allow-same-origin allow-scripts allow-popups allow-forms allow-modals"src="YOUR_EMBED_URL"style="border: 0;"></iframe>