Query Channel Document Transcoding Status
Updated: 2022-09-02 18:08:07
API Description
1、查询频道文档转换状态接口
2、支持https协议
API URL
http://api.polyv.net/live/v3/channel/document/status/get
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details: Signature Generation Rules |
| channelId | true | String | Channel ID |
| fileId | true | String | File ID(s). For multiple IDs, concatenate them with English commas. This value originates from the data.contents[0].fileId returned by the Query Channel Uploaded Document List API. |
Example
http://api.polyv.net/live/v3/channel/document/status/get?appId=frlr1zazn3&sign=EB9CF9CD3F473E0C6462E3031E97E7FA&channelId=1965681×tamp=1621843039780&fileId=c2d585857870f4eff024976e3a265c0b1965681common%2C6e0603f6c8ec6113b87f69a7191d22021965681common
Response Parameters Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See details: Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, it provides additional error details. |
| data | Array | On success, contains channel transcoding information. See details: Data Parameter Description. On failure, it is empty. |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| imageCount | Integer | Number of large images. Returned when convertStatus is "normal". |
| images | String[] | Array of large image URLs. Returned when convertStatus is "normal". Example: ["imgurl1", "imgurl2"] |
| smallImages | String[] | Array of small image URLs. Returned when convertStatus is "normal". Example: ["imgurl1", "imgurl2"] |
| totalPage | Integer | Total number of pages. Returned when convertStatus is "normal". |
| htmlUrl | String | Animated PPT URL. Returned when convertStatus is "normal". |
| convertStatus | String | Document status. Default queries all statuses if not specified. normal: Normal waitUpload: Waiting for upload failUpload: Upload failed waitConvert: Converting PPT failConvert: PPT conversion failed |
| type | String | Conversion type. Default is common if not specified. Only ppt and pptx can be converted to animation; other file types are automatically converted to common. If animation conversion fails, the type is automatically changed to common. common: Convert to regular images animate: Convert to animated effects |
| fileId | String | File ID |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelDocTest.class);
/**
* 查询频道文档转码状态
* @throws IOException
*/
@Test
public void testGetDocConvertStatus() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v3/channel/document/status/get";
String channelId = "1965681";
String fileId = "c2d585857870f4eff024976e3a265c0b1965681common,6e0603f6c8ec6113b87f69a7191d22021965681common";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("fileId",fileId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道文档转码状态:{}",response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success Example
{
"code":200,
"status":"success",
"message":"",
"data":[
{
"imageCount":1,
"smallImages":[
"http://doc-2.polyv.net/images/2020/10/c2d585857870f4eff024976e3a265c0b1965681common/c2d585857870f4eff024976e3a265c0b1965681common_0000_s.jpeg"
],
"images":[
"http://doc-2.polyv.net/images/2020/10/c2d585857870f4eff024976e3a265c0b1965681common/c2d585857870f4eff024976e3a265c0b1965681common_0000.jpeg"
],
"totalPage":1,
"htmlUrl":null,
"convertStatus":"normal",
"type":"common",
"fileId":"c2d585857870f4eff024976e3a265c0b1965681common"
},
{
"imageCount":1,
"smallImages":[
"http://doc-2.polyv.net/images/2020/10/6e0603f6c8ec6113b87f69a7191d22021965681common/6e0603f6c8ec6113b87f69a7191d22021965681common_0000_s.jpeg"
],
"images":[
"http://doc-2.polyv.net/images/2020/10/6e0603f6c8ec6113b87f69a7191d22021965681common/6e0603f6c8ec6113b87f69a7191d22021965681common_0000.jpeg"
],
"totalPage":1,
"htmlUrl":null,
"convertStatus":"normal",
"type":"common",
"fileId":"6e0603f6c8ec6113b87f69a7191d22021965681common"
}
]
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
