需要 write_content 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20230901/store/blogs/:blog_collection_id/articles.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
指定博客集合创建博客
路径参数
  • blog_collection_id string required
    博客集合id
    Example: 6220bb59a02a436fee85d0cb
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • blogobject
    博客信息
  • author string
    博客的作者
    Example: demo-author
  • content_html string
    博客正文的文本,带有 HTML 标记,限制5M
    Example: <p>demo-content</p>
  • digest string
    博客的摘要
    Example: demo-digest
  • handle string required
    博客的handle
    Example: demo-blogs
  • imageobject
    博客的封面信息
  • alt string
    图片alt
    Example: demo-alt
  • src string
    图片链接
    Example: https://img-va.myshopline.com/image/store/2000199350/1627973520413/8f787c19722d4db6bd9d98ea0fd620cb.
  • published boolean
    是否发布,可选值:true(发布);false(不发布)
    Example: true
  • published_at string
    发布时间 ISO 8601
    Example: 2022-02-25T16:15:47+08:00
  • template_name string
    关联的模板名称
    Example: templates/blogs/list.json
  • title string required
    博客的标题
    Example: demo blogs
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • blogobject
    博客信息
  • author string
    博客的作者
    Example: demo-author
  • blog_collection_id string
    博客集合的id
    Example: 6220bb59a02a436fee85d0cb
  • content_html string
    博客正文的文本,带有 HTML 标记
    Example: <p>demo-content</p>
  • created_at string
    创建时间 ISO 8601
    Example: 2022-02-25T16:15:47+08:00
  • digest string
    博客的摘要
    Example: demo-digest
  • handle string
    博客的handle
    Example: demo-handle
  • id string
    博客的id
    Example: 6220bb59a02a436fee85d0cb
  • imageobject
    博客的封面信息
  • alt string
    图片alt
    Example: demo-alt
  • src string
    图片链接
    Example: https://img-va.myshopline.com/image/store/2000199350/1627973520413/8f787c19722d4db6bd9d98ea0fd620cb.
  • published_at string
    发布时间 ISO 8601
    Example: 2022-02-25T16:15:47+08:00
  • title string
    博客标题
    Example: demo-title
  • updated_at string
    更新时间 ISO 8601
    Example: 2022-02-25T16:15:47+08:00
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20230901

ParamOptions

— path required
— header required

Body

required
{
  "blog": {
    "author": "demo-author",
    "content_html": "<p>demo-content</p>",
    "digest": "demo-digest",
    "handle": "demo-blogs",
    "image": {
      "alt": "demo-alt",
      "src": "https://img-va.myshopline.com/image/store/2000199350/1627973520413/8f787c19722d4db6bd9d98ea0fd620cb."
    },
    "published": true,
    "published_at": "2022-02-25T16:15:47+08:00",
    "template_name": "templates/blogs/list.json",
    "title": "demo blogs"
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20230901/store/blogs/blog_collection_id/articles.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
{
"blog": {
"author": "demo-author",
"content_html": "<p>demo-content</p>",
"digest": "demo-digest",
"handle": "demo-blogs",
"image": {
"alt": "demo-alt",
"src": "https://img-va.myshopline.com/image/store/2000199350/1627973520413/8f787c19722d4db6bd9d98ea0fd620cb."
},
"published_at": "2022-02-25T16:15:47+08:00",
"template_name": "templates/blogs/list.json",
"title": "demo blogs"
}
}
Response
{
"blog": {
"author": "demo-author",
"blog_collection_id": "63a9a344609552261f00f23e",
"content_html": "<p>demo-content</p>",
"created_at": "2022-12-27T14:43:29+08:00",
"digest": "demo-digest",
"handle": "demo-blogs-1",
"id": "63aa94116b7b014b289c0752",
"image": {
"alt": "demo-alt",
"src": "https://img-va.myshopline.com/image/store/2000199350/1627973520413/8f787c19722d4db6bd9d98ea0fd620cb."
},
"published_at": "2022-02-25T16:15:47+08:00",
"title": "demo blogs",
"updated_at": "2022-12-27T14:43:29+08:00"
}
}
这篇文章对你有帮助吗?

Error loading component.

Error loading component.