---
title: "更新营销拓展活动"
description: "更新营销拓展活动"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/marketing/marketing-events/update-marketing-expansion'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/marketing/marketing-events/update-marketing-expansion.md'
---
# 更新营销拓展活动

更新营销拓展活动

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_marketing_event`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /sales/marketing_activity_extension/:marketing_activity_id.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_marketing_event`

## Request

### Path Parameters

* `marketing_activity_id`

  string (required)

  营销拓展活动id

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

### Request Body

* `marketing_activity`

  object

  营销拓展活动

  * `utm_term`

    string

    标识搜索关键字

  * `utm_campaign`

    string

    标识具体广告标识

  * `ended_at`

    string

    结束时间

  * `form_data`

    string

    JSON的表单数据序列化为字符串

  * `utm_medium`

    string

    标识来源类型（电子邮件，文章）

  * `marketing_activity_title`

    string

    营销拓展活动标题

  * `started_at`

    string

    开始时间

  * `status`

    string

    营销活动之前的状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除

  * `target_status`

    string

    营销活动要更换的目标状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除

  * `utm_content`

    string

    区分同一广告内的不同链接

  * `utm_source`

    string

    标识广告客户、广告网站

  * `remote_id`

    string

    【App】数据的唯一id

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `400`

  

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `marketing_activity`

  object

  营销拓展活动

  * `remote_id`

    string

    【App】数据的唯一id

  * `target_status`

    string

    营销活动要更换的目标状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除

  * `utm_campaign`

    string

    标识具体广告标识

  * `utm_source`

    string

    标识广告客户、广告网站

  * `utm_term`

    string

    标识搜索关键字

  * `marketing_activity_id`

    string

    营销拓展活动ID

  * `utm_medium`

    string

    标识来源类型（电子邮件，文章）

  * `marketing_activity_title`

    string

    营销活动的标题

  * `utm_content`

    string

    区分同一广告内的不同链接

  * `ended_at`

    string

    结束时间

  * `started_at`

    string

    开始时间

  * `status`

    string

    营销活动之前的状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除

  * `form_data`

    string

    JSON的表单数据序列化为字符串


#### 400

* `errors`

  string

  错误描述。


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "更新营销拓展活动",
  "externalDocs": {
    "description": "接口使用的权限点: `write_marketing_event` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "fJXmtwWa",
  "parameters": [
    {
      "name": "marketing_activity_id",
      "in": "path",
      "description": "营销拓展活动id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "marketing_activity_id",
        "description": "营销拓展活动id",
        "type": "string",
        "example": ""
      },
      "example": "",
      "examples": {
        "编辑一个不存在的营销扩展活动": {
          "value": "MA_6019932248375043369"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "marketing_activity": {
              "name": "marketing_activity",
              "description": "营销拓展活动",
              "type": "object",
              "properties": {
                "utm_term": {
                  "name": "utm_term",
                  "description": "标识搜索关键字",
                  "type": "string",
                  "example": "this is utm term name"
                },
                "utm_campaign": {
                  "name": "utm_campaign",
                  "description": "标识具体广告标识",
                  "type": "string",
                  "example": "google"
                },
                "ended_at": {
                  "name": "ended_at",
                  "description": "结束时间",
                  "type": "string",
                  "example": "2022-12-15T09:00:00+08:00"
                },
                "form_data": {
                  "name": "form_data",
                  "description": "JSON的表单数据序列化为字符串",
                  "type": "string",
                  "example": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}"
                },
                "utm_medium": {
                  "name": "utm_medium",
                  "description": "标识来源类型（电子邮件，文章）",
                  "type": "string",
                  "example": "email"
                },
                "marketing_activity_title": {
                  "name": "marketing_activity_title",
                  "description": "营销拓展活动标题",
                  "type": "string",
                  "example": "This is marketing activity title"
                },
                "started_at": {
                  "name": "started_at",
                  "description": "开始时间",
                  "type": "string",
                  "example": "2022-12-15T09:00:00+08:00"
                },
                "status": {
                  "name": "status",
                  "description": "营销活动之前的状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除",
                  "type": "string",
                  "example": "draft"
                },
                "target_status": {
                  "name": "target_status",
                  "description": "营销活动要更换的目标状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除",
                  "type": "string",
                  "example": "active"
                },
                "utm_content": {
                  "name": "utm_content",
                  "description": "区分同一广告内的不同链接",
                  "type": "string",
                  "example": "googleAds"
                },
                "utm_source": {
                  "name": "utm_source",
                  "description": "标识广告客户、广告网站",
                  "type": "string",
                  "example": "www.shopline.com"
                },
                "remote_id": {
                  "name": "remote_id",
                  "description": "【App】数据的唯一id",
                  "type": "string",
                  "example": "c219fd95-3f9f-4c96-b995-e3b40f87d321"
                }
              },
              "example": {
                "ended_at": "2022-12-15T09:00:00+08:00",
                "utm_campaign": "google",
                "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                "target_status": "active",
                "utm_content": "googleAds",
                "marketing_activity_title": "This is marketing activity title",
                "started_at": "2022-12-15T09:00:00+08:00",
                "utm_medium": "email",
                "utm_term": "this is utm term name",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                "utm_source": "www.shopline.com",
                "status": "draft"
              }
            }
          },
          "example": {
            "marketing_activity": {
              "status": "draft",
              "target_status": "active",
              "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
              "marketing_activity_title": "This is marketing activity title",
              "utm_campaign": "google",
              "ended_at": "2022-12-15T09:00:00+08:00",
              "started_at": "2022-12-15T09:00:00+08:00",
              "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
              "utm_content": "googleAds",
              "utm_medium": "email",
              "utm_source": "www.shopline.com",
              "utm_term": "this is utm term name"
            }
          }
        },
        "examples": {
          "编辑一个不存在的营销扩展活动": {
            "value": {
              "marketing_activity": {
                "marketing_activity_title": "This is marketing activity title",
                "utm_content": "googleAds",
                "utm_campaign": "google",
                "utm_term": "this is utm term name",
                "utm_source": "www.shopline.com",
                "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                "started_at": "2022-12-15T09:00:00+08:00",
                "status": "draft",
                "utm_medium": "email",
                "ended_at": "2024-12-15T09:00:00+08:00",
                "target_status": "active",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}"
              }
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "marketing_activity": {
                "name": "marketing_activity",
                "description": "营销拓展活动",
                "type": "object",
                "properties": {
                  "remote_id": {
                    "name": "remote_id",
                    "description": "【App】数据的唯一id",
                    "type": "string",
                    "example": "c219fd95-3f9f-4c96-b995-e3b40f87d321"
                  },
                  "target_status": {
                    "name": "target_status",
                    "description": "营销活动要更换的目标状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除",
                    "type": "string",
                    "example": "active"
                  },
                  "utm_campaign": {
                    "name": "utm_campaign",
                    "description": "标识具体广告标识",
                    "type": "string",
                    "example": "google"
                  },
                  "utm_source": {
                    "name": "utm_source",
                    "description": "标识广告客户、广告网站",
                    "type": "string",
                    "example": "www.shopline.com"
                  },
                  "utm_term": {
                    "name": "utm_term",
                    "description": "标识搜索关键字",
                    "type": "string",
                    "example": "this is utm term name"
                  },
                  "marketing_activity_id": {
                    "name": "marketing_activity_id",
                    "description": "营销拓展活动ID",
                    "type": "string",
                    "example": "MA_5797003750150774786"
                  },
                  "utm_medium": {
                    "name": "utm_medium",
                    "description": "标识来源类型（电子邮件，文章）",
                    "type": "string",
                    "example": "email"
                  },
                  "marketing_activity_title": {
                    "name": "marketing_activity_title",
                    "description": "营销活动的标题",
                    "type": "string",
                    "example": "This is marketing activity title"
                  },
                  "utm_content": {
                    "name": "utm_content",
                    "description": "区分同一广告内的不同链接",
                    "type": "string",
                    "example": "googleAds"
                  },
                  "ended_at": {
                    "name": "ended_at",
                    "description": "结束时间",
                    "type": "string",
                    "example": "2022-12-15T09:00:00+08:00"
                  },
                  "started_at": {
                    "name": "started_at",
                    "description": "开始时间",
                    "type": "string",
                    "example": "2022-12-15T09:00:00+08:00"
                  },
                  "status": {
                    "name": "status",
                    "description": "营销活动之前的状态，draft：草稿，failed：失败，active：生效，inactive：已完成，scheduled：已安排，paused：已暂停，deleted_externally：已在外部删除",
                    "type": "string",
                    "example": "draft"
                  },
                  "form_data": {
                    "name": "form_data",
                    "description": "JSON的表单数据序列化为字符串",
                    "type": "string",
                    "example": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}"
                  }
                },
                "example": {
                  "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                  "started_at": "2022-12-15T09:00:00+08:00",
                  "ended_at": "2022-12-15T09:00:00+08:00",
                  "marketing_activity_id": "MA_5797003750150774786",
                  "utm_content": "googleAds",
                  "utm_campaign": "google",
                  "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                  "status": "draft",
                  "utm_source": "www.shopline.com",
                  "target_status": "active",
                  "marketing_activity_title": "This is marketing activity title",
                  "utm_term": "this is utm term name",
                  "utm_medium": "email"
                }
              }
            },
            "example": {
              "marketing_activity": {
                "utm_campaign": "google",
                "utm_source": "www.shopline.com",
                "marketing_activity_id": "MA_5797003750150774786",
                "target_status": "active",
                "marketing_activity_title": "This is marketing activity title",
                "remote_id": "c219fd95-3f9f-4c96-b995-e3b40f87d321",
                "started_at": "2022-12-15T09:00:00+08:00",
                "status": "draft",
                "form_data": "{\\\"budget\\\":{\\\"frequency\\\":\\\"DAILY\\\",\\\"currency\\\":\\\"TWD\\\"},\\\"time\\\":{\\\"startTime\\\":1671275280000,\\\"endTime\\\":1671361680000}}",
                "utm_content": "googleAds",
                "utm_term": "this is utm term name",
                "ended_at": "2022-12-15T09:00:00+08:00",
                "utm_medium": "email"
              }
            }
          }
        }
      }
    },
    "400": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "name": "errors",
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          },
          "examples": {
            "编辑一个不存在的营销扩展活动": {
              "value": {}
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/sales/marketing_activity_extension/:marketing_activity_id.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "更新营销拓展活动",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_marketing_event"
  ]
}
```