Generate a provider token
post
/content/published/api/v1.1/items/{id}/providerTokens
for a published asset.
Request
Supported Media Types
- application/json
Path Parameters
-
id: string
Unique identifier (ID) of an item.
Query Parameters
-
channelToken(optional): string
Channel token of the publish target. A channel token must be provided as either a query parameter or a request header.
Header Parameters
-
X-Requested-With: string
A custom header to mitigate CSRF attacks.Allowed Values:
[ "XMLHttpRequest" ]
Model class for generating provider token requests
Root Schema : ProviderToken
Type:
object
ProviderToken
Show Source
-
permissions(optional):
array permissions
permissions with which a token is to be generated; valid permissions are: view, download, contribute, and manage
-
provider:
object Provider
Provider
-
scope(optional):
object scope
Additional Properties Allowed: additionalPropertiesprovider specific properties to future identify a target for which a token is to be generated
-
token(optional):
string
Read Only:
true
generated token value
Nested Schema : permissions
Type:
array
permissions with which a token is to be generated; valid permissions are: view, download, contribute, and manage
Show Source
Nested Schema : scope
Type:
object
Additional Properties Allowed
Show Source
provider specific properties to future identify a target for which a token is to be generated
Nested Schema : additionalProperties
Type:
object
Response
Supported Media Types
- application/json
200 Response
Successful operation.
Root Schema : ProviderToken
Type:
object
ProviderToken
Show Source
-
permissions(optional):
array permissions
permissions with which a token is to be generated; valid permissions are: view, download, contribute, and manage
-
provider:
object Provider
Provider
-
scope(optional):
object scope
Additional Properties Allowed: additionalPropertiesprovider specific properties to future identify a target for which a token is to be generated
-
token(optional):
string
Read Only:
true
generated token value
Nested Schema : permissions
Type:
array
permissions with which a token is to be generated; valid permissions are: view, download, contribute, and manage
Show Source
Nested Schema : scope
Type:
object
Additional Properties Allowed
Show Source
provider specific properties to future identify a target for which a token is to be generated
Nested Schema : additionalProperties
Type:
object
400 Response
Bad Request. The server is unable to process the request on the client side due to malformed syntax, invalid data or message framing.
403 Response
Forbidden. Client is not authorized to perform this request.
404 Response
The requested resource was not found.
500 Response
Internal server error. An unexpected error condition encountered in the system.
Examples
The following example shows how to create a provider token for a published asset.
curl -i -X POST -H 'Content-Type:application/json' -H 'X-Requested-With: XMLHttpRequest' 'http://<hostname>/content/published/api/v1.1/items/{id}/providerTokens'
Example 1
This generates a kaltura provider preview token for a published asset with id CONTB94719ABE603404BAE0D808C59989FF9.
/content/published/api/v1.1/items/CONTB94719ABE603404BAE0D808C59989FF9/providerTokens?channelToken=d20844efa0d143f8b343e0aaeb4d2caf
Request Payload
{ "provider": { "name": "kaltura" }, "scope": { "entry": { "id": "0_8t3brdui" } } }
Request Headers
{ "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" }
Response Body
{ "provider": { "name": "kaltura" }, "permissions": [ "view" ], "token": "djJ8MjcwNTc3MnyrFUVElvYu5GMYZJQOUMjTloB-oN2EbZ325YuunBinE4XNsCgY4H5p5-oZ-qES7OSUWBljkVrKIX6lZ9qwc3VVmkvo0WlExGHOaxEdhIlB_iwZrBqoTaGD8RE2y-6uKMjRBdB5XI23fa7FuB6vH2g0" }