**版本：202201**

# 更新Script Tag

**PUT** `/openapi/2022-01/script_tags_new/:id`

## 请求

**Path参数**

- `id` string (required)

  Script's ID

**application/json**

**请求体 | 示例**

**请求体**

- `src` string (required)

  Script file url, for example: [https://www.shoplazza.com/x.js](https://www.shoplazza.com/x.js)
- `display_scope` string

  Display scope, for example: `index`
- `event_type` string

  Tag type, for example: `myapp`

```json
{
  "src": "string",
  "display_scope": "string",
  "event_type": "string"
}
```

## 响应

**200 | 404 | 422**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `script_tag` object

  - `id` string

    **示例：** `f50950fa-40ec-441f-b98d-e1869050dbf2`
  - `display_scope` string

    **示例：** `all`
  - `event_type` string

    **示例：** `app`
  - `src` string

    **示例：** `https://shoplazza.com/x.js`
  - `created_at` string

    **示例：** `2024-04-29T03:22:50Z`
  - `updated_at` string

    **示例：** `2024-04-29T05:59:40Z`

```json
{
  "script_tag": {
    "id": "f50950fa-40ec-441f-b98d-e1869050dbf2",
    "display_scope": "all",
    "event_type": "app",
    "src": "https://shoplazza.com/x.js",
    "created_at": "2024-04-29T03:22:50Z",
    "updated_at": "2024-04-29T05:59:40Z"
  }
}
```

```json
{
  "script_tag": {
    "id": "f50950fa-40ec-441f-b98d-e1869050dbf2",
    "display_scope": "all",
    "event_type": "app",
    "src": "https://shoplazza.com/x.js",
    "created_at": "2024-04-29T03:22:50Z",
    "updated_at": "2024-04-29T05:59:40Z"
  }
}
```

404

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "record not found"
  ]
}
```

```json
{
  "errors": [
    "record not found"
  ]
}
```

422

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "src not is file url"
  ]
}
```

```json
{
  "errors": [
    "src not is file url"
  ]
}
```
