---
id: "770d0d2d33a921c88e6b"
url: "https://www.xmcsl.cn/project/ocean-engine-api/%E6%9B%B4%E6%96%B0%E8%A7%86%E9%A2%91-1696710605909004.html"
source_url: "https://open.oceanengine.com/labels/7/docs/1696710605909004"
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: "f22cb8a34363552aab39079d5bdf03d4a4c05c0ada4584bf7e8ce8896f455cc6"
---

# 更新视频 — 巨量引擎 API

# 更新视频

 

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

 

💡通过此接口，用户可以批量更新素材视频的名称。需配合【获取Access token】接口获取授权access\_token，对于短漫剧行业白名单客户，可通过【查询白名单能力】接口查询账户是否具备特定标签能力。 通过此接口，用户可以批量更新素材视频的名称。

 

POST https://api.oceanengine.com/open\_api/2/file/video/update/ <a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1696710605909004">🔍 可视化调试</a> <a href="https://open.oceanengine.com/labels/7/docs/1773083358100557">📦 SDK下载</a>

 

## 接口说明

 

通过此接口，用户可以批量更新素材视频的名称。需配合【获取Access token】接口获取授权access\_token，对于短漫剧行业白名单客户，可通过【查询白名单能力】接口查询账户是否具备特定标签能力。

 

通过此接口，用户可以批量更新素材视频的名称。

 

## 请求地址

 

https://api.oceanengine.com/open\_api/2/file/video/update/<a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1696710605909004">可视化调试</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>advertiser&#95;id</code></td>&#10;<td>number</td>&#10;<td>必填</td>&#10;<td>客户ID</td>&#10;</tr>&#10;</tbody>&#10;</table>

 

<code>videos</code>（object\[\]，必填） — 限制最多 100 个

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`video\_id\` \| string \| 必填 \| 视频id \| \| \`filename\` \| string \| 必填 \| 视频素材名称，最多255个字 \| \| \`labels\` \| string\[\] \| 否 \| 标签\- 注意：采用全量更新逻辑。不传该字段默认不更新；传入非空数组将完全替换该视频当前的所有标签；传入空数组即清空当前所有标签。  
\- 请优先为无需付费信息的素材传入\`仅IAA\`标签，标记该素材仅IAA模式投放，不参与IAP模式投放；未传入该标签，素材默认为通用素材，可同时参与IAA和IAP投放。（该标签能力仅对短漫剧行业白名单客户生效，您可通过\[【查询白名单能力】\](https://open.oceanengine.com/labels/7/docs/1763407285579840)接口传入gray\_key = \`R3\_material\`查询您的账户是否具备该能力。未开通权限的账户传入标签将返回错误） \|

 

## 请求示例

 

### 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/video/update/"


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__':
    advertiser_id = ADVERTISER_ID
    video_id = VIDEO_ID
    filename = FILENAME
    labels_list = LABELS
    labels = json.dumps(labels_list)

    # Args in JSON format
    my_args = "{\"advertiser_id\": \"%s\", \"videos\": [{\"video_id\": \"%s\", \"filename\": \"%s\", \"labels\": %s}]}" % (advertiser_id, video_id, filename, labels)
    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/video/update/";
    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 advertiser_id = ADVERTISER_ID;
        String video_id = VIDEO_ID;
        String filename = FILENAME;
        List < String > labels_list = LABELS;
        String labels = mapper.writeValueAsString(labels_list);

        // Args in JSON format
        String myArgs = String.format("{\"advertiser_id\": \"%s\", \"videos\": [{\"video_id\": \"%s\", \"filename\": \"%s\", \"labels\": %s}]}",advertiser_id, video_id, filename, labels);
        System.out.println(post(myArgs));
    }
}
```

 

### php

 

```php
$ACCESS_TOKEN = "xxx";
$PATH = "/open_api/2/file/video/update/";

/**
 * 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;
}


$advertiser_id = ADVERTISER_ID;
$video_id = VIDEO_ID;
$filename = FILENAME;
$labels_list = LABELS;
$labels = json_encode($labels_list);

/* Args in JSON format */
$my_args = sprintf("{\"advertiser_id\": \"%s\", \"videos\": [{\"video_id\": \"%s\", \"filename\": \"%s\", \"labels\": %s}]}", $advertiser_id, $video_id, $filename, $labels);
echo post($my_args);
```

 

### curl

 

```curl
curl -H "Access-Token:xxx" -H "Content-Type:application/json" -X POST \
-d '{
    "advertiser_id": "ADVERTISER_ID",
    "videos": [
        {
            "video_id": "VIDEO_ID",
            "filename": "FILENAME",
            "labels": [
                "LABELS"
            ]
        }
    ]
}' \
https://api.oceanengine.com/open_api/2/file/video/update/
```

 

## 应答字段

 

<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返回值

 

<code>videos</code>（object\[\]，否） — 视频列表

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`video\_id\` \| string \| 否 \| 视频id \| \| \`labels\` \| string\[\] \| 否 \| 标签 \| \| \`status\_code\` \| number \| 否 \| 更新状态\- \`SUCCESS\` 成功  
\- \`FAILURE\` 失败（原因：操作视频非当前客户所有或操作的视频不存在） \|

 

<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>文档
