---
title: "创建一个博客集合"
description: "创建一个博客集合"
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/blog-collection/create-a-blog-collection'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/blog-collection/create-a-blog-collection.md'
---
# 创建一个博客集合

创建一个博客集合

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

## Endpoint

```http
POST /store/blogs.json
```

## Base URL

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

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

## Required Permissions

* `write_content`

## Request

### 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 格式传入。

### Request Body

* `blog`

  object

  博客集合信息

  * `title`

    string

    博客集合的标题

  * `commentable`

    string

    评论配置，枚举值：no（不能发布评论）；moderate（默认，可以发布评论，但是需要审核）；yes（可以发布评论且不需要审核自动发布成功）

  * `handle`

    string

    博客集合的handle

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

* `blog`

  object

  博客集合信息

  * `template_suffix`

    string

    模版的名称

  * `title`

    string

    博客集合的标题

  * `updated_at`

    string

    更新时间 ISO 8601

  * `commentable`

    string

    评论配置，枚举值：no（不能发布评论）；moderate（默认，可以发布评论，但是需要审核）；yes（可以发布评论且不需要审核自动发布成功）

  * `created_at`

    string

    创建时间 ISO 8601

  * `handle`

    string

    博客集合的handle

  * `id`

    string

    博客集合的id


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "创建一个博客集合",
  "externalDocs": {
    "description": "接口使用的权限点: `write_content` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "LDiTTMju",
  "parameters": [
    {
      "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"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "blog": {
              "name": "blog",
              "description": "博客集合信息",
              "type": "object",
              "properties": {
                "title": {
                  "name": "title",
                  "description": "博客集合的标题",
                  "type": "string",
                  "example": "demo blogs"
                },
                "commentable": {
                  "name": "commentable",
                  "description": "评论配置，枚举值：no（不能发布评论）；moderate（默认，可以发布评论，但是需要审核）；yes（可以发布评论且不需要审核自动发布成功）",
                  "type": "string",
                  "example": "moderate"
                },
                "handle": {
                  "name": "handle",
                  "description": "博客集合的handle",
                  "type": "string",
                  "example": "demo-blogs"
                }
              },
              "required": [
                "handle",
                "title"
              ],
              "example": {
                "handle": "demo-blogs",
                "title": "demo blogs",
                "commentable": "moderate"
              }
            }
          },
          "example": {
            "blog": {
              "commentable": "moderate",
              "handle": "demo-blogs",
              "title": "demo blogs"
            }
          }
        },
        "examples": {
          "创建一个博客集合": {
            "value": {
              "blog": {
                "commentable": "moderate",
                "handle": "blogs-handle",
                "title": "blogs-title"
              }
            }
          }
        }
      }
    },
    "required": true
  },
  "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": {
              "blog": {
                "name": "blog",
                "description": "博客集合信息",
                "type": "object",
                "properties": {
                  "template_suffix": {
                    "name": "template_suffix",
                    "description": "模版的名称",
                    "type": "string",
                    "example": "templates/blogs/list.json"
                  },
                  "title": {
                    "name": "title",
                    "description": "博客集合的标题",
                    "type": "string",
                    "example": "demo blogs"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "更新时间 ISO 8601",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "commentable": {
                    "name": "commentable",
                    "description": "评论配置，枚举值：no（不能发布评论）；moderate（默认，可以发布评论，但是需要审核）；yes（可以发布评论且不需要审核自动发布成功）",
                    "type": "string",
                    "example": "moderate"
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "创建时间 ISO 8601",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "handle": {
                    "name": "handle",
                    "description": "博客集合的handle",
                    "type": "string",
                    "example": "demo-blogs"
                  },
                  "id": {
                    "name": "id",
                    "description": "博客集合的id",
                    "type": "string",
                    "example": "63a9a344609552261f00f23e"
                  }
                },
                "example": {
                  "created_at": "2022-08-03T10:45:00+08:00\t\n",
                  "handle": "demo-blogs",
                  "id": "63a9a344609552261f00f23e",
                  "template_suffix": "templates/blogs/list.json",
                  "title": "demo blogs",
                  "updated_at": "2022-08-03T10:45:00+08:00\t\n",
                  "commentable": "moderate"
                }
              }
            },
            "example": {
              "blog": {
                "id": "63a9a344609552261f00f23e",
                "template_suffix": "templates/blogs/list.json",
                "title": "demo blogs",
                "updated_at": "2022-08-03T10:45:00+08:00\t\n",
                "commentable": "moderate",
                "created_at": "2022-08-03T10:45:00+08:00\t\n",
                "handle": "demo-blogs"
              }
            }
          },
          "examples": {
            "创建一个博客集合": {
              "value": {
                "blog": {
                  "commentable": "moderate",
                  "created_at": "2022-12-26T22:00:34+08:00",
                  "handle": "blogs-handle",
                  "id": "63a9a902a2714654f07ed586",
                  "title": "blogs-title",
                  "updated_at": "2022-12-26T22:00:34+08:00"
                }
              }
            }
          }
        }
      }
    },
    "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": "post",
  "path": "/store/blogs.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "创建一个博客集合",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_content"
  ]
}
```