All Products
Document Center


Last Updated: Jul 11, 2019


You can call this operation to obtain the playback credential required for video playback.

Request parameters

Name Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to GetVideoPlayAuth.
VideoId String Yes The ID of the video.
AuthInfoTimeout Long No The expiration time of the playback credential. Valid values: 100~3000.
Default value: 100. Unit: seconds.
PlayConfig PlayConfig No The custom playback configuration. The value is a JSON-formatted string. If multiple playback domain names are configured, you can specify a domain name.
ReAuthInfo ReAuthInfo No The CDN reauthentication configuration. The value is a JSON-formatted string. If CDN reauthentication is enabled, you can use this parameter to set the uid and rand fields for URL signing. For more information, see URL signing.

Response parameters

Name Type Description
RequestId String The ID of the request.
VideoMeta VideoMeta The video metadata.
PlayAuth String The video playback credential.

API examples

Sample request<Common request parameters>

Note: For more information about common request parameters, see Common parameters.

Sample response

JSON format

     "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
     "VideoMeta": {
         "VideoId": "93ab850b4f6f44eab54b6e91d24d81d4",
         "Title": "ApsaraVideo for VOD",
         "Duration": 135.6,
         "CoverURL": "",
         "Status": "Normal"
      "PlayAuth": "sstyYuew678999ew90000000xtt7TYUh"

Error codes

This operation also returns common errors. For more information about errors common to all operations, see common errors.

Error code Error message HTTP status code Description
Forbidden.IllegalStatus Status of the video is illegal. 403 The error message returned because the video status is invalid.
InvalidVideo.NotFound The video does not exist. 404 The error message returned because the specified video does not exist.

SDK examples

We recommend that you use a server SDK to call this operation. For more information about the sample code used to call this operation in various languages, see the following topics: