Appearance
上传视频号视频
把视频和封面上传到视频号,返回的 data 整个作为发布视频号视频的 videoCdn 传入。
接口地址: POST /finderUpload
说明与注意
videoUrl、imgUrl要让接口服务能访问到。
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| wId | 是 | string | 登录实例标识 |
| videoUrl | 是 | string | 视频文件链接 |
| imgUrl | 是 | string | 视频封面图片链接 |
请求示例
http
POST {BASE_URL}/finderUpload
Authorization: Bearer <你的调用凭证>
Content-Type: application/json
{
"wId": "{{wId}}",
"videoUrl": "https://cdn.e-yun.example/feed/customer-case.mp4",
"imgUrl": "https://cdn.e-yun.example/feed/customer-case-cover.jpeg"
}bash
curl -X POST '{BASE_URL}/finderUpload' \
-H 'Authorization: Bearer <你的调用凭证>' \
-H 'Content-Type: application/json' \
--data-raw '{
"wId": "{{wId}}",
"videoUrl": "https://cdn.e-yun.example/feed/customer-case.mp4",
"imgUrl": "https://cdn.e-yun.example/feed/customer-case-cover.jpeg"
}'python
import requests
url = "{BASE_URL}/finderUpload"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
"wId": "{{wId}}",
"videoUrl": "https://cdn.e-yun.example/feed/customer-case.mp4",
"imgUrl": "https://cdn.e-yun.example/feed/customer-case-cover.jpeg"
}"""
resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String url = "{BASE_URL}/finderUpload";
String body = "{\n" +
" \"wId\": \"{{wId}}\",\n" +
" \"videoUrl\": \"https://cdn.e-yun.example/feed/customer-case.mp4\",\n" +
" \"imgUrl\": \"https://cdn.e-yun.example/feed/customer-case-cover.jpeg\"\n" +
"}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
.header("Authorization", "Bearer <你的调用凭证>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());php
<?php
$url = '{BASE_URL}/finderUpload';
$body = <<<'JSON'
{
"wId": "{{wId}}",
"videoUrl": "https://cdn.e-yun.example/feed/customer-case.mp4",
"imgUrl": "https://cdn.e-yun.example/feed/customer-case-cover.jpeg"
}
JSON;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <你的调用凭证>',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;成功响应
json
{
"code": "1000",
"message": "处理成功",
"data": {
"fileUrl": "http://wxapp.tc.qq.com/251/20302/stodownload?...",
"thumbUrl": "http://wxapp.tc.qq.com/251/20350/stodownload?...",
"mp4Identify": "5118be81f2de929d3c79fc8777732b43",
"fileSize": 1315979,
"thumbMd5": "cc9a86fb446c70f5ed6c16ca7754f4c1",
"fileKey": "finder_upload_6764713041_zhangchuan2288"
}
}错误响应
json
{
"code": "1001",
"message": "失败",
"data": null
}响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | 1000 成功;其他值都是失败,通常是 1001 |
| message | string | 反馈信息 |
| data | object | 上传后的文件信息 |
| data.fileUrl | string | 上传后的视频文件地址 |
| data.thumbUrl | string | 上传后的封面地址 |
| data.mp4Identify | string | 视频文件标识 |
| data.fileSize | number | 视频文件大小 |
| data.thumbMd5 | string | 封面 MD5 |
| data.fileKey | string | 上传文件 key,发布视频时使用 |