---
id: "260e3d34e8150db5e81c"
url: "https://www.xmcsl.cn/project/ocean-engine-api/%E5%BC%82%E6%AD%A5%E4%B8%8A%E4%BC%A0%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6-1801533703648324.html"
source_url: "https://open.oceanengine.com/labels/7/docs/1801533703648324"
source_date: null
checked_at: "2026-11-05T04:21:48.909937+00:00"
status: "ready"
check_scope: "structure_only; not a factual or human review"
body_sha256: "ab07dfaf2d5680a8571583c23d7c9c78364dc98cbf030f2eea2356954f560073"
---

# 异步上传视频文件 — 巨量引擎 API

# 异步上传视频文件

 

<table><tr><th>关键信息</th><th>详情</th></tr><tr><th>文档 ID</th><td>1801533703648324</td></tr>&#10;<tr><th>标签 ID</th><td>7</td></tr>&#10;<tr><th>原始文档</th><td>&#91;https://open.oceanengine.com/labels/7/docs/1801533703648324&#93;(https://open.oceanengine.com/labels/7/docs/1801533703648324)</td></tr>&#10;<tr><th>接口标识</th><td>file.upload&#95;task.create</td></tr>&#10;</table>

 

💡将视频文件通过连山云素材服务上传后获取到视频文件链接，再将获取到的连山云视频文件url作为入参的video\_url通过素材库提供的视频上传接口进行文件上传。仅支持开发者购置连山云素材服务上传生成的tos链接/连山点播云产品的视频链接上传，不支持其他三方链接地址。 将视频文件通过连山云素材服务上传后获取到视频文件链接，再将获取到的连山云视频文件url作为入参的video\_url通过素材库提供的视频上传接口进行文件上传 仅支持开发者购置连山云素材服务上传生成的tos链接/连山点播云产品的视频链接上传，不支持其他三方链接地址

 

POST \[https://api.oceanengine.com/open\_api/2/file/upload\_task/create/\](https://api.oceanengine.com/open\_api/2/file/upload\_task/create/) <a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1801533703648324">🔍 可视化调试</a> <a href="https://open.oceanengine.com/labels/7/docs/1773083358100557">📦 SDK下载</a>

 

## 接口说明

 

将视频文件通过连山云素材服务上传后获取到视频文件链接，再将获取到的连山云视频文件url作为入参的video\_url通过素材库提供的视频上传接口进行文件上传。仅支持开发者购置连山云素材服务上传生成的tos链接/连山点播云产品的视频链接上传，不支持其他三方链接地址。

 

将视频文件通过连山云素材服务上传后获取到视频文件链接，再将获取到的连山云视频文件url作为入参的video\_url通过素材库提供的视频上传接口进行文件上传

 

仅支持开发者购置连山云素材服务上传生成的tos链接/连山点播云产品的视频链接上传，不支持其他三方链接地址

 

## 请求地址

 

<a href="https://api.oceanengine.com/open_api/2/file/upload_task/create/">https://api.oceanengine.com/open&#95;api/2/file/upload&#95;task/create/</a><a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1801533703648324">可视化调试</a><a href="https://open.oceanengine.com/labels/7/docs/1773083358100557">SDK下载</a><a href="https://open.oceanengine.com/labels/7/docs/1847394521222599">MCP调用</a>

 

## 请求方法

 

POST

 

## Header

 

<table>&#10;<thead>&#10;<tr>&#10;<th>字段</th>&#10;<th>类型</th>&#10;<th>必填</th>&#10;<th>描述</th>&#10;</tr>&#10;</thead>&#10;<tbody>&#10;<tr>&#10;<td><code>Access-Token</code></td>&#10;<td>string</td>&#10;<td>必填</td>&#10;<td>授权access&#95;token，可以通过【<a href="https://open.oceanengine.com/labels/7/docs/1696710505596940">获取Access token</a>】接口获取</td>&#10;</tr>&#10;<tr>&#10;<td><code>Content-Type</code></td>&#10;<td>string</td>&#10;<td>必填</td>&#10;<td>请求消息类型<br>允许值: <code>application/json</code></td>&#10;</tr>&#10;</tbody>&#10;</table>

 

## 请求参数

 

<table>&#10;<thead>&#10;<tr>&#10;<th>字段</th>&#10;<th>类型</th>&#10;<th>必填</th>&#10;<th>描述</th>&#10;</tr>&#10;</thead>&#10;<tbody>&#10;<tr>&#10;<td><code>account&#95;id</code></td>&#10;<td>number</td>&#10;<td>必填</td>&#10;<td>账户ID</td>&#10;</tr>&#10;<tr>&#10;<td><code>account&#95;type</code></td>&#10;<td>string</td>&#10;<td>必填</td>&#10;<td>账户类型，允许值：<code>ADVERTISER</code> 客户、<code>AGENT</code> 代理商、<code>EBP</code> 企业版工作台</td>&#10;</tr>&#10;<tr>&#10;<td><code>filename</code></td>&#10;<td>string</td>&#10;<td>必填</td>&#10;<td>素材的文件名</td>&#10;</tr>&#10;<tr>&#10;<td><code>labels</code></td>&#10;<td>string&#91;&#93;</td>&#10;<td>否</td>&#10;<td>标签，每个标签长度是10，最大支持50个label- 请优先为无需付费信息的素材传入<code>仅IAA</code>标签，标记该素材仅IAA模式投放，不参与IAP模式投放；未传入该标签，素材默认为通用素材，可同时参与IAA和IAP投放。（该标签能力仅对短漫剧行业白名单客户生效，您可通过<a href="https://open.oceanengine.com/labels/7/docs/1763407285579840">【查询白名单能力】</a>接口传入gray&#95;key =<code>R3&#95;material</code>查询您的账户是否具备该能力。未开通权限的账户传入标签将返回错误）</td>&#10;</tr>&#10;<tr>&#10;<td><code>video&#95;url</code></td>&#10;<td>string</td>&#10;<td>必填</td>&#10;<td>视频 url地址，最大支持上传文件大小：1000M- 支持连山云视频点播产品的视频链接上传，具体见<a href="https://www.volcengine.com/docs/4/1469303">接入指南</a><br>- 支持开发者购置连山云素材服务上传生成的tos链接 具体见<a href="https://ad.oceanengine.com/cloud/doc/1756427622851659">接入指南</a></td>&#10;</tr>&#10;<tr>&#10;<td><code>is&#95;aigc</code></td>&#10;<td>bool</td>&#10;<td>否</td>&#10;<td>视频素材是否为AIGC生成</td>&#10;</tr>&#10;<tr>&#10;<td><code>is&#95;guide&#95;video</code></td>&#10;<td>bool</td>&#10;<td>否</td>&#10;<td>上传视频场景是否是引导视频（此功能仅游戏行业白名单客户可用，如需使用请联系运营）</td>&#10;</tr>&#10;<tr>&#10;<td><code>is&#95;need&#95;auth</code></td>&#10;<td>bool</td>&#10;<td>条件必填</td>&#10;<td>标注是否允许生效授权保护（素材需要是自产）- 当account&#95;type= <code>AGTENT</code>时有效且必填，目前只支持true</td>&#10;</tr>&#10;</tbody>&#10;</table>

 

## 请求示例

 

### python

 

```python
# coding=utf-8
import json
import requests

from six import string_types
from six.moves.urllib.parse import urlencode, urlunparse  # noqa

ACCESS_TOKEN = "xxx"
PATH = "/open_api/2/file/upload_task/create/"


def build_url(path, query=""):
    # type: (str, str) -> str
    """
    Build request URL
    :param path: Request path
    :param query: Querystring
    :return: Request URL
    """
    scheme, netloc = "https", "api.oceanengine.com"
    return urlunparse((scheme, netloc, path, "", query, ""))

def post(json_str):
    # type: (str) -> dict
    """
    Send POST request
    :param json_str: Args in JSON format
    :return: Response in JSON format
    """
    url = build_url(PATH)
    args = json.loads(json_str)
    headers = {
        "Access-Token": ACCESS_TOKEN,
        "Content-Type": "application/json",
    }
    rsp = requests.post(url, headers=headers, json=args)
    return rsp.json()


if __name__ == '__main__':
    account_id = ACCOUNT_ID
    account_type = ACCOUNT_TYPE
    filename = FILENAME
    labels_list = LABELS
    labels = json.dumps(labels_list)
    video_url = VIDEO_URL
    is_aigc = IS_AIGC
    is_guide_video = IS_GUIDE_VIDEO
    is_need_auth = IS_NEED_AUTH

    # Args in JSON format
    my_args = "{\"account_id\": \"%s\", \"account_type\": \"%s\", \"filename\": \"%s\", \"labels\": %s, \"video_url\": \"%s\", \"is_aigc\": \"%s\", \"is_guide_video\": \"%s\", \"is_need_auth\": \"%s\"}" % (account_id, account_type, filename, labels, video_url, is_aigc, is_guide_video, is_need_auth)
    print(post(my_args))
```

 

### java

 

```java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.*;
import org.apache.http.client.utils.URIBuilder;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class Demo {
    private static final String ACCESS_TOKEN = "xxx";
    private static final String PATH = "/open_api/2/file/upload_task/create/";
    private static final ObjectMapper mapper = new ObjectMapper();

    /**
     * Build request URL
     *
     * @param path Request path
     * @return Request URL
     */
    private static String buildUrl(String path) throws URISyntaxException {
        URI uri = new URI("https", "api.oceanengine.com", path, "", "");
        return uri.toString();
    }


    /**
     * Send POST request
     *
     * @param jsonStr Args in JSON format
     * @return Response in JSON format
     */
    private static String post(String jsonStr) throws IOException, URISyntaxException {
        OkHttpClient client = new OkHttpClient().newBuilder().build();
        String url = buildUrl(PATH);

        RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonStr);
        Request request = new Request.Builder()
                .url(url)
                .method("POST", body)
                .addHeader("Content-Type", "application/json")
                .addHeader("Access-Token", ACCESS_TOKEN)
                .build();
        Response response = client.newCall(request).execute();
        return response.body().string();
    }


    public static void main(String[] args) throws IOException, URISyntaxException {
        Long account_id = ACCOUNT_ID;
        String account_type = ACCOUNT_TYPE;
        String filename = FILENAME;
        List < String > labels_list = LABELS;
        String labels = mapper.writeValueAsString(labels_list);
        String video_url = VIDEO_URL;
        String is_aigc = IS_AIGC;
        String is_guide_video = IS_GUIDE_VIDEO;
        String is_need_auth = IS_NEED_AUTH;

        // Args in JSON format
        String myArgs = String.format("{\"account_id\": \"%s\", \"account_type\": \"%s\", \"filename\": \"%s\", \"labels\": %s, \"video_url\": \"%s\", \"is_aigc\": \"%s\", \"is_guide_video\": \"%s\", \"is_need_auth\": \"%s\"}",account_id, account_type, filename, labels, video_url, is_aigc, is_guide_video, is_need_auth);
        System.out.println(post(myArgs));
    }
}
```

 

### php

 

```php
$ACCESS_TOKEN = "xxx";
$PATH = "/open_api/2/file/upload_task/create/";

/**
 * Build request URL
 * @param $path : Request path
 * @return string
 */
function build_url($path)
{
    return "https://api.oceanengine.com" . $path;
}


/**
 * Send POST request
 * @param $json_str : Args in JSON format
 * @return bool|string : Response in JSON format
 */
function post($json_str)
{
    global $ACCESS_TOKEN, $PATH;
    $curl = curl_init();

    $url = build_url($PATH);

    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => $json_str,
        CURLOPT_HTTPHEADER => array(
            "Content-Type: application/json",
            "Access-Token: " . $ACCESS_TOKEN,
        ),
    ));

    $response = curl_exec($curl);
    curl_close($curl);
    return $response;
}


$account_id = ACCOUNT_ID;
$account_type = ACCOUNT_TYPE;
$filename = FILENAME;
$labels_list = LABELS;
$labels = json_encode($labels_list);
$video_url = VIDEO_URL;
$is_aigc = IS_AIGC;
$is_guide_video = IS_GUIDE_VIDEO;
$is_need_auth = IS_NEED_AUTH;

/* Args in JSON format */
$my_args = sprintf("{\"account_id\": \"%s\", \"account_type\": \"%s\", \"filename\": \"%s\", \"labels\": %s, \"video_url\": \"%s\", \"is_aigc\": \"%s\", \"is_guide_video\": \"%s\", \"is_need_auth\": \"%s\"}", $account_id, $account_type, $filename, $labels, $video_url, $is_aigc, $is_guide_video, $is_need_auth);
echo post($my_args);
```

 

### curl

 

```curl
curl -H "Access-Token:xxx" -H "Content-Type:application/json" -X POST \
-d '{
    "account_id": "ACCOUNT_ID",
    "account_type": "ACCOUNT_TYPE",
    "filename": "FILENAME",
    "labels": [
        "LABELS"
    ],
    "video_url": "VIDEO_URL",
    "is_aigc": "IS_AIGC",
    "is_guide_video": "IS_GUIDE_VIDEO",
    "is_need_auth": "IS_NEED_AUTH"
}' \
https://api.oceanengine.com/open_api/2/file/upload_task/create/
```

 

## 应答字段

 

<table>&#10;<thead>&#10;<tr>&#10;<th>字段</th>&#10;<th>类型</th>&#10;<th>必填</th>&#10;<th>描述</th>&#10;</tr>&#10;</thead>&#10;<tbody>&#10;<tr>&#10;<td><code>code</code></td>&#10;<td>number</td>&#10;<td>否</td>&#10;<td>返回码,详见 <a href="https://open.oceanengine.com/labels/7/docs/1696710760866831">【附录-返回码】</a></td>&#10;</tr>&#10;<tr>&#10;<td><code>message</code></td>&#10;<td>string</td>&#10;<td>否</td>&#10;<td>返回信息,详见 <a href="https://open.oceanengine.com/labels/7/docs/1696710760866831">【附录-返回码】</a></td>&#10;</tr>&#10;</tbody>&#10;</table>

 

<code>data</code>（json，否） — json返回值

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`task\_id\` \| number \| 否 \| 任务ID \|

 

<table>&#10;<thead>&#10;<tr>&#10;<th>字段</th>&#10;<th>类型</th>&#10;<th>必填</th>&#10;<th>描述</th>&#10;</tr>&#10;</thead>&#10;<tbody>&#10;<tr>&#10;<td><code>request&#95;id</code></td>&#10;<td>string</td>&#10;<td>否</td>&#10;<td>请求日志id</td>&#10;</tr>&#10;</tbody>&#10;</table>

 

## 应答示例

 

```json
HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {}
}
```

 

## 业务错误码

 

仅披露当前接口高频的参数校验报错，更多常见报错详见<a href="https://open.oceanengine.com/labels/34/docs/1696710760866831">「返回码」</a>文档
