Polyv Help Center

Help Center

Get PPT Document Upload Token API for a Channel

Updated: 2022-05-24 09:38:10

API URL

http://api.polyv.net/live/v3/channel/document/token/get

API Description

1. Provides an API to obtain a token for uploading PPT documents.
2. Supports HTTPS.

Supported Format

JSON

Request Method

GET

Request Rate Limit

TRUE

Request Parameters

Parameter Required Type Description
appId Yes string Obtained from API settings, the appId registered in the live streaming system.
timestamp Yes string Current time in seconds (13-digit Unix timestamp).
sign Yes string Signature, a 32-character uppercase MD5 value.
channelId Yes int Channel ID.
fileId Yes string File ID (Format: MD5 value of the generated file as value1, channel ID as value2, type string value as value3 ('common' for regular PPT, 'animate' for animated PPT). fileId = value1 + value2 + value3. The value1 (i.e., the file's MD5 value) can also be generated by MD5 hashing the file name + file modification time. The file ID must be generated strictly according to this format to ensure uniqueness and support for instant upload within the same channel and file.)
fileName Yes string File name (including file extension. Allowed extensions: .ppt, .pptx, .pdf, .doc, .docx, .wps).
type Yes string File conversion type: "common" for regular PPT, "animate" for animated PPT.

Example of Successful Response

{
  "code": 200,
  "status": "success",
  "message": "",
  "data": {
    "encodedCallback": "xxxxxxxxxxxxxxxxxxxx",
    "convertStatus": "waitUpload",
    "host": "xxx.xxx.xxx",
    "callback": "xxxxxxxxxxxxxxxxxxxx",
    "policy": "xxxxx",
    "dir": "xxxxxx",
    "endpoint": "xxxxxxx",
    "bucket": "bucket",
    "expire": "xdadada",
    "accessId": "xxxx",
    "policy": "policy",
    "signature": "signature"
  }
}

Example of Failed Response

Signature Error

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

Missing parameter channelId

{
    "code": 400,
    "status": "error"
    "message": "param should not be empty: channelId",
    "data": ""
}

Invalid File ID

{
    "code": 400,
    "status": "error"
    "message": "illegal document fileId",
    "data": ""
}

Response Field Description

Name Type Description
code string Response code: 200 for success, 400 for failure, 403 for signature error, 500 for server error.
status string "success" for success, "error" for failure.
message string Error message when an error occurs.
data string Successful response object.
data.convertStatus string PPT status: "normal" - no need to re-upload, a matching PPT already exists and is successfully uploaded; proceed to polling. "waitConvert" - PPT is being converted, a matching file is already in conversion; proceed to polling. "waitUpload" - waiting for upload; proceed to upload to Alibaba Cloud OSS.
data.autoId int Auto-incrementing file ID.
data.fileId string File ID.
data.accessId string OSS upload OSSAccessKeyId.
data.policy string OSS upload policy.
data.signature string OSS upload signature.
data.dir string Upload directory on OSS.
data.endpoint string OSS upload endpoint.
data.bucket string OSS upload bucket.
data.host string OSS upload host.
data.expire string Expiration time of the encrypted string.
data.callback string OSS upload callback parameter (must be included to notify the backend of the upload status).
data.encodedCallback string OSS upload callback parameter using encode encoding (must be included when uploading to OSS to notify the backend of the upload status).
data.object string Document storage directory key.
联系客服,在线咨询