需要 write_page 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20260301/store/page/customize.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
为店铺创建自定义页面。
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。
    例子:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • reqobject required
    请求参数。
  • author string required
    自定义页面的创建者 ID 或名称。
    例子: Alvin
  • body_html string
    自定义页的正文内容,包含 HTML 标签。
    文件大小不得超过16MB
    例子: <p>We love to hear from you.</p>
  • handle string required
    自定义页面的语义化标识符。
    例子: contact-us
  • published_at string
    自定义页面的发布时间,不得早于当前时间。当 published_statusfalse 时,该发布时间表示定时发布。格式:yyyy-MM-dd HH:mm:ss.SSS
    例子: 2023-09-11 16:49:35.120
  • published_status boolean
    是否发布自定义页面。
    • true:立即发布。
    • false:暂不发布或定时发布,定时发布需填写 published_at 字段。
    默认取值为 true
  • template_name string
    自定义页面使用的模版名称。
    例子: templates/page.contact.json
  • template_type integer
    自定义页面使用的模版类型。模版类型包含:
    • 0:默认主题模板。
    • 1:公共模版,所有主题均可使用。
    • 2:通过应用定义的主题模版,仅对当前主题生效 。
    默认取值为0
  • title string required
    自定义页面的标题。
    最大长度限制:255
    例子: Contact us
  • url string
    自定义页面 URL 的相对路径,详情参考 URL 结构设置 了解自定义 URL 相关内容。
    最大长度限制:512
    例子: /pages/contact_us
状态码
更多状态码信息,参考 HTTP 状态码

响应头
  • traceId
    请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
  • dataobject
    自定义页面信息。
  • author string
    自定义页面的创建者 ID 或名称。
    例子: Alvin
  • body_html string
    自定义页的正文内容,包含 HTML 标签。
    例子: <p>We love to hear from you.</p>
  • created_at string
    自定义页面的创建时间。格式:yyyy-MM-dd HH:mm:ss.SSS
    例子: 2023-09-11 16:49:35.000
  • handle string
    自定义页面的语义化标识符。
    例子: contact-us
  • id string
    自定义页面的唯一标识 ID。
    例子: 6743314731912662424
  • published_at string
    自定义页面的发布时间。格式:yyyy-MM-dd HH:mm:ss.SSS
    例子: 2023-09-11 16:49:35.120
  • published_status boolean
    是否发布自定义页面。
    • true:已发布。
    • false:未发布。
  • store_id long
    店铺的唯一标识 ID。
    例子: 1730104825803
  • template_name string
    自定义页面使用的模版名称。
    例子: templates/page.contact.json
  • title string
    自定义页面的标题。
    例子: Contact us
  • updated_at string
    自定义页面的更新时间。格式:yyyy-MM-dd HH:mm:ss.SSS
    例子: 2023-09-11 16:49:35.120
  • msg string
    响应信息,包含成功或失败原因。
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

header required

Body

required
{
  "req": {
    "author": "Alvin",
    "body_html": "<p>We love to hear from you.</p>",
    "handle": "contact-us",
    "published_at": "2023-09-11 16:49:35.120",
    "published_status": null,
    "template_name": "templates/page.contact.json",
    "template_type": null,
    "title": "Contact us",
    "url": "/pages/contact_us"
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/store/page/customize.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
创建自定义页面
Request
{
"req": {
"author": "shopline",
"body_html": "MY CUSTOM PAGE CONTENT",
"handle": "my-custom-page",
"published_at": "2023-09-07 17:17:02.86",
"published_status": "true",
"template_name": "templates/page.json",
"template_type": 2,
"title": "MY CUSTOM PAGE 5"
}
}
Response
{
"data": {
"author": "shopline",
"body_html": "MY CUSTOM PAGE CONTENT",
"created_at": "2025-04-21 16:11:14",
"handle": "my-custom-page",
"id": "6960782449417390048",
"published_at": "2025-04-21 16:11:14.299",
"published_status": true,
"store_id": "1672369729606",
"template_name": "templates/page.json",
"title": "MY CUSTOM PAGE 5",
"updated_at": "2025-04-21 16:11:14"
},
"msg": "success"
}
这篇文章对你有帮助吗?