Skip to main content

Custom User IDs & Membership

Generate Resource/Playback Tokens to Enable Content Playback

We provide the capabilities to generate tokens for playbacks, which can be used to authenticate and authorize access to specific resources, such as live streams or VOD content. This is crucial for integrating iframe solutions or player SDKs to play authorized content.

There are two types of tokens:

  • Resource Token: If you want to integrate the iframe solution, the resource token is generated to play the authorized content.
  • Playback Token: If you want to integrate the player SDK, the playback token is generated for the player to authenticate and play the authorized content.

Generate a Resource Token

To create a resource token, you need to send a POST request to the following API:

POST /bv/cms/v1/resources/tokens

The request body should include the following parameters:

NameTypeRequiredDescription
resource_idstringYesThe unique ID of the live stream or VOD content.
resource_typestringYesThe type of resource. Allowed values: RESOURCE_TYPE_LIVE for live streams and RESOURCE_TYPE_VOD for VOD content.
customer_idstringOptionalThis parameter is required if the resource's security privacy is set to SECURITY_PRIVACY_TYPE_TOKEN. It is used to identify who is playing the resource.
customer_namestringOptionalThe name of the customer.

Here is an example of a request body:

{
"resource_id": "<resource-id>",
"resource_type": "RESOURCE_TYPE_LIVE",
"customer_id": "<customer-id>",
"customer_name": "<customer-name>"
}

A successful response will return a resource token:

{
"token": "AbCdEfGhIjKlMnOpQrSt"
}

Generate a Playback Token

To create a playback token, you need to send a POST request to the following API:

POST /bv/cms/v1/tokens

The request body should include the following parameters:

NameTypeRequiredDescription
resource_idstringYesThe unique ID of the live stream or VOD content.
resource_typestringYesThe type of resource. Allowed values: RESOURCE_TYPE_LIVE for live streams and RESOURCE_TYPE_VOD for VOD content.
customer_idstringOptionalThis parameter is required if the resource's security privacy is set to SECURITY_PRIVACY_TYPE_TOKEN. It is used to identify who is playing the resource.

Here is an example of a request body:

{
"resource_id": "<resource-id>",
"resource_type": "RESOURCE_TYPE_LIVE",
"customer_id": "<customer-id>"
}

A successful response will return a playback token:

{
"token": "AbCdEfGhIjKlMnOpQrSt"
}