创建脚本标签
POST /openapi/2023-10/script_tags
权限:write_script_tags
REST参数
参数名
说明
必填
类型
值可能性
限制
示例
id
脚本标签ID
是
[string]
1
Body参数
参数名
说明
必填
类型
值可能性
示例
src
脚本内容
是
[string]
display_scope
执行脚本页面范围
是
[string]
all: 所有页面
online_store: 正常浏览页面
order_status: 订单结果页面 custom:自定义页面
custom_page
自定义页面
当 display_scope 为 custom 的时候,此字段为必填
[string]
index:首页 product_detail:商品详情页 cart:购物车页 category_detail :分类详情页 search:搜索页 404:404页面 order_result:订单结果页
index,search
code_position
代码位置
是
[string]
top:顶部 bottom:底部
示例请求内容
curl --location --request POST 'https://example.hotishop.com/openapi/2023-10/script_tags' \
--header 'Authorization: {access-token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"src": "<script src=\"https://eg.com/jqeury.js\"></script>",
"display_event": "online_store"
}'
示例响应内容
{
"id": 1234,
"src": "<script src=\"https://eg.com/jqeury.js\"></script>",
"display_scope": "online_store",
"created_at_gmt": "2021-09-09 00:00:00",
"updated_at_gmt": "2021-09-09 00:00:00"
}
Last updated