---
title: "查询单个script tag"
description: "查询单个script tag"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/script-tag/query-a-single-script-tag'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/script-tag/query-a-single-script-tag.md'
---
# 查询单个script tag

查询单个script tag

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

## Endpoint

```http
GET /store/:script_tag_id.json
```

## Base URL

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

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

## Required Permissions

* `read_script_tags`

## Request

### Path Parameters

* `script_tag_id`

  string (required)

  script标识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 格式传入。

## 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)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

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

### Response Body

#### 200

* `script_tag`

  object

  object

  * `updated_at`

    string

    上次更新脚本标记的日期和时间 ( ISO 8601 )

  * `cache`

    boolean

    缓存标识

  * `created_at`

    string

    创建脚本标记的日期和时间 ( ISO 8601 )

  * `display_scope`

    string

    显示范围，在线商店上应包含脚本的页面。有效值：online_store（包含首页、列表页、详情页、购物车页、搜索页、404页、自定义页面、博客集合、博客）；checkout（结算页，包含结算三步和状态页）；all：（在网上店面和订单状态页面上都包含脚本，包含上方两个范围）

  * `event`

    string

    触发脚本加载的 DOM 事件。有效值：onload

  * `id`

    string

    标识script tag的id

  * `src`

    string

    远程脚本的 URL


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "查询单个script tag",
  "externalDocs": {
    "description": "接口使用的权限点: `read_script_tags` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "il8i74AL",
  "parameters": [
    {
      "name": "script_tag_id",
      "in": "path",
      "description": "script标识id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "script_tag_id",
        "description": "script标识id",
        "type": "string",
        "example": "61a75c4e9f8c201e6e9473e0"
      },
      "example": "61a75c4e9f8c201e6e9473e0",
      "examples": {
        "查询指定 script tag": {
          "value": "64fecde8baa12e20b784ab2a"
        }
      }
    },
    {
      "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"
    }
  ],
  "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": {
              "script_tag": {
                "name": "script_tag",
                "description": "object",
                "type": "object",
                "properties": {
                  "updated_at": {
                    "name": "updated_at",
                    "description": "上次更新脚本标记的日期和时间 ( ISO 8601 )",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "cache": {
                    "name": "cache",
                    "description": "缓存标识",
                    "type": "boolean",
                    "example": false
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "创建脚本标记的日期和时间 ( ISO 8601 )",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "display_scope": {
                    "name": "display_scope",
                    "description": "显示范围，在线商店上应包含脚本的页面。有效值：online_store（包含首页、列表页、详情页、购物车页、搜索页、404页、自定义页面、博客集合、博客）；checkout（结算页，包含结算三步和状态页）；all：（在网上店面和订单状态页面上都包含脚本，包含上方两个范围）",
                    "type": "string",
                    "example": "all"
                  },
                  "event": {
                    "name": "event",
                    "description": "触发脚本加载的 DOM 事件。有效值：onload",
                    "type": "string",
                    "example": "onload"
                  },
                  "id": {
                    "name": "id",
                    "description": "标识script tag的id",
                    "type": "string",
                    "example": "61a75c4e9f8c201e6e9473e0"
                  },
                  "src": {
                    "name": "src",
                    "description": "远程脚本的 URL",
                    "type": "string",
                    "example": "https://djavaskripped.org/fancy.js"
                  }
                },
                "example": {
                  "src": "https://djavaskripped.org/fancy.js",
                  "updated_at": "2022-08-03T10:45:00+08:00\t\n",
                  "cache": false,
                  "created_at": "2022-08-03T10:45:00+08:00\t\n",
                  "display_scope": "all",
                  "event": "onload",
                  "id": "61a75c4e9f8c201e6e9473e0"
                }
              }
            },
            "example": {
              "script_tag": {
                "cache": false,
                "created_at": "2022-08-03T10:45:00+08:00\t\n",
                "display_scope": "all",
                "event": "onload",
                "id": "61a75c4e9f8c201e6e9473e0",
                "src": "https://djavaskripped.org/fancy.js",
                "updated_at": "2022-08-03T10:45:00+08:00\t\n"
              }
            }
          },
          "examples": {
            "查询指定 script tag": {
              "value": {
                "script_tag": {
                  "event": "onload",
                  "id": "64fecde8baa12e20b784ab2a",
                  "src": "https://js.example.com/example.js",
                  "updated_at": "2023-09-11T16:42:38+08:00",
                  "cache": false,
                  "created_at": "2023-09-11T16:20:56+08:00",
                  "display_scope": "all"
                }
              }
            }
          }
        }
      }
    },
    "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": "get",
  "path": "/store/:script_tag_id.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "查询单个script tag",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_script_tags"
  ]
}
```