---
id: "080e785e5af0bde43fa9"
url: "https://www.xmcsl.cn/project/ocean-engine-api/%E6%89%B9%E9%87%8F%E6%9B%B4%E6%96%B0%E9%A1%B9%E7%9B%AE%E6%8A%95%E6%94%BE%E6%97%B6%E6%AE%B5-1779260654537728.html"
source_url: "https://open.oceanengine.com/labels/34/docs/1779260654537728?origin=left_nav"
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: "a68c2c81775db1fe75cc0962cd9d2ab9160edf3a6629bb0104cec0eecefe8400"
---

# 批量更新项目投放时段 — 巨量引擎 API

# 批量更新项目投放时段

 

<table><tr><th>关键信息</th><th>详情</th></tr><tr><th>文档 ID</th><td>1779260654537728</td></tr>&#10;<tr><th>标签 ID</th><td>34</td></tr>&#10;<tr><th>原始文档</th><td>&#91;https://open.oceanengine.com/labels/34/docs/1779260654537728?origin=left&#95;nav&#93;(https://open.oceanengine.com/labels/34/docs/1779260654537728?origin=left&#95;nav)</td></tr>&#10;<tr><th>接口标识</th><td>marketing.project&#95;week&#95;schedule.update</td></tr>&#10;</table>

 

💡批量更新「巨量营销升级版」项目投放时段，不允许修改搜索周期投放项目的投放时段，项目下营销会逐批完成修改，涉及营销数量过多时会有短暂延迟。配合使用的接口有【获取Access token】。 批量更新「巨量营销升级版」项目投放时段 1. 不允许修改搜索周期投放项目的投放时段（项目层级delivery\_type =\`DURATION\`） 2. 项目下营销会逐批完成修改，涉及营销数量过多时会有短暂延迟

 

POST \[https://api.oceanengine.com/open\_api/v3.0/project/week\_schedule/update/\](https://api.oceanengine.com/open\_api/v3.0/project/week\_schedule/update/) <a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1779260654537728">🔍 可视化调试</a> <a href="https://open.oceanengine.com/labels/7/docs/1773083358100557">📦 SDK下载</a>

 

## 接口说明

 

批量更新「巨量营销升级版」项目投放时段，不允许修改搜索周期投放项目的投放时段，项目下营销会逐批完成修改，涉及营销数量过多时会有短暂延迟。配合使用的接口有【获取Access token】。

 

批量更新「巨量营销升级版」项目投放时段

 

<ol>&#10;<li>不允许修改搜索周期投放项目的投放时段（项目层级delivery&#95;type =<code>DURATION</code>）</li>&#10;<li>项目下营销会逐批完成修改，涉及营销数量过多时会有短暂延迟</li>&#10;</ol>

 

## 请求地址

 

<a href="https://api.oceanengine.com/open_api/v3.0/project/week_schedule/update/">https://api.oceanengine.com/open&#95;api/v3.0/project/week&#95;schedule/update/</a><a href="https://open.oceanengine.com/tools/visual_debug.html?docId=1779260654537728">可视化调试</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>data</code>（object\[\]，必填） — 批量修改投放时段，限制最多批量修改10个项目

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`project\_id\` \| number \| 必填 \| 项目ID \| \| \`schedule\_time\` \| string \| 必填 \| 更新后的投放时段，格式是48\*7位字符串，且都是0或1。也就是以半个小时为最小粒度，周一至周日每天分为48个区段，0为不投放，1为投放，不传、全传0、全传1均代表全时段投放。  
例如：000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000001111000000000000000000000  
则投放时段为周一到周日的11:30\~13:30 \| \| \`schedule\_scene\` \| string \| 必填 \| 生效方式，允许值：\- \`NEXT\_DAY\` 次日0点生效  
\- \`REALTIME\` 立即生效  
默认值: \`REALTIME\` \|

 

## 请求示例

 

### 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/v3.0/project/week_schedule/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
    project_id = PROJECT_ID
    schedule_time = SCHEDULE_TIME
    schedule_scene = SCHEDULE_SCENE

    # Args in JSON format
    my_args = "{\"advertiser_id\": \"%s\", \"data\": [{\"project_id\": \"%s\", \"schedule_time\": \"%s\", \"schedule_scene\": \"%s\"}]}" % (advertiser_id, project_id, schedule_time, schedule_scene)
    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/v3.0/project/week_schedule/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;
        Long project_id = PROJECT_ID;
        String schedule_time = SCHEDULE_TIME;
        String schedule_scene = SCHEDULE_SCENE;

        // Args in JSON format
        String myArgs = String.format("{\"advertiser_id\": \"%s\", \"data\": [{\"project_id\": \"%s\", \"schedule_time\": \"%s\", \"schedule_scene\": \"%s\"}]}",advertiser_id, project_id, schedule_time, schedule_scene);
        System.out.println(post(myArgs));
    }
}
```

 

### php

 

```php
$ACCESS_TOKEN = "xxx";
$PATH = "/open_api/v3.0/project/week_schedule/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;
$project_id = PROJECT_ID;
$schedule_time = SCHEDULE_TIME;
$schedule_scene = SCHEDULE_SCENE;

/* Args in JSON format */
$my_args = sprintf("{\"advertiser_id\": \"%s\", \"data\": [{\"project_id\": \"%s\", \"schedule_time\": \"%s\", \"schedule_scene\": \"%s\"}]}", $advertiser_id, $project_id, $schedule_time, $schedule_scene);
echo post($my_args);
```

 

### curl

 

```curl
curl -H "Access-Token:xxx" -H "Content-Type:application/json" -X POST \
-d '{
    "advertiser_id": "ADVERTISER_ID",
    "data": [
        {
            "project_id": "PROJECT_ID",
            "schedule_time": "SCHEDULE_TIME",
            "schedule_scene": "SCHEDULE_SCENE"
        }
    ]
}' \
https://api.oceanengine.com/open_api/v3.0/project/week_schedule/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返回值

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`project\_ids\` \| number\[\] \| 否 \| 更新成功的项目ID集合 \| 

<code>errors</code>（object\[\]，否） — 更新失败的项目ID列表

 \| 字段 \| 类型 \| 必填 \| 描述 \| \| \-\-\- \| \-\-\- \| \-\-\- \| \-\-\- \| \| \`project\_id\` \| number \| 否 \| 项目ID \| \| \`error\_message\` \| string \| 否 \| 错误信息 \|

 

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