---
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/comments/comment-for-recovery-delete'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/online-store/comments/comment-for-recovery-delete.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/comments/:comment_id/restore.json
```

## Base URL

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

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

## Required Permissions

* `write_content`

## Request

### Path Parameters

* `comment_id`

  string (required)

  需要恢复的评论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

* `comment`

  object

  评论信息

  * `body_html`

    string

    含有html标记的body内容

  * `email`

    string

    评论作者的邮件地址

  * `blog_collection_id`

    string

    评论所属的文章归属的博客集合id

  * `blog_id`

    string

    评论所属博客id

  * `id`

    string

    评论id

  * `updated_at`

    string

    更新时间 ISO 8601

  * `author`

    string

    评论的作者

  * `published_at`

    string

    发布评论的时间 ISO 8601

  * `status`

    string

    评论状态，枚举值：unapproved（默认状态，评论等待批准，C端不展示此状态评论）； published：（已发布状态，并且对C端用户可见）； spam：（垃圾评论，C端用户不可见）； removed：（评论标记为已删除状态，C端用户不可见）

  * `user_agent`

    string

    用户代理

  * `body`

    string

    评论内容

  * `create_at`

    string

    评论的创建时间 ISO 8601

  * `ip`

    string

    发表评论的ip


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "恢复删除的评论",
  "externalDocs": {
    "description": "接口使用的权限点: `write_content` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "ad1uSxzz",
  "parameters": [
    {
      "name": "comment_id",
      "in": "path",
      "description": "需要恢复的评论id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "comment_id",
        "description": "需要恢复的评论id",
        "type": "string",
        "example": "63804260a0a9ba4487960881"
      },
      "example": "63804260a0a9ba4487960881",
      "examples": {
        "恢复删除的评论": {
          "value": "63804260a0a9ba4487960881"
        }
      }
    },
    {
      "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": {
              "comment": {
                "name": "comment",
                "description": "评论信息",
                "type": "object",
                "properties": {
                  "body_html": {
                    "name": "body_html",
                    "description": "含有html标记的body内容",
                    "type": "string",
                    "example": "<p>demo-content</p>"
                  },
                  "email": {
                    "name": "email",
                    "description": "评论作者的邮件地址",
                    "type": "string",
                    "example": "demo@qq.com"
                  },
                  "blog_collection_id": {
                    "name": "blog_collection_id",
                    "description": "评论所属的文章归属的博客集合id",
                    "type": "string",
                    "example": "632c137a0fe5b42e60a04b62"
                  },
                  "blog_id": {
                    "name": "blog_id",
                    "description": "评论所属博客id",
                    "type": "string",
                    "example": "63804260a0a9ba4487960881"
                  },
                  "id": {
                    "name": "id",
                    "description": "评论id",
                    "type": "string",
                    "example": "63804260a0a9ba4487960881"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "更新时间 ISO 8601",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "author": {
                    "name": "author",
                    "description": "评论的作者",
                    "type": "string",
                    "example": "demo-author"
                  },
                  "published_at": {
                    "name": "published_at",
                    "description": "发布评论的时间 ISO 8601",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "status": {
                    "name": "status",
                    "description": "评论状态，枚举值：unapproved（默认状态，评论等待批准，C端不展示此状态评论）； published：（已发布状态，并且对C端用户可见）； spam：（垃圾评论，C端用户不可见）； removed：（评论标记为已删除状态，C端用户不可见）",
                    "type": "string",
                    "example": "unapproved"
                  },
                  "user_agent": {
                    "name": "user_agent",
                    "description": "用户代理",
                    "type": "string",
                    "example": ""
                  },
                  "body": {
                    "name": "body",
                    "description": "评论内容",
                    "type": "string",
                    "example": "demo-content"
                  },
                  "create_at": {
                    "name": "create_at",
                    "description": "评论的创建时间 ISO 8601",
                    "type": "string",
                    "example": "2022-08-03T10:45:00+08:00\t\n"
                  },
                  "ip": {
                    "name": "ip",
                    "description": "发表评论的ip",
                    "type": "string",
                    "example": "172.28.173.136"
                  }
                },
                "example": {
                  "blog_collection_id": "632c137a0fe5b42e60a04b62",
                  "email": "demo@qq.com",
                  "updated_at": "2022-08-03T10:45:00+08:00\t\n",
                  "author": "demo-author",
                  "blog_id": "63804260a0a9ba4487960881",
                  "body_html": "<p>demo-content</p>",
                  "body": "demo-content",
                  "create_at": "2022-08-03T10:45:00+08:00\t\n",
                  "ip": "172.28.173.136",
                  "status": "unapproved",
                  "published_at": "2022-08-03T10:45:00+08:00\t\n",
                  "user_agent": "",
                  "id": "63804260a0a9ba4487960881"
                }
              }
            },
            "example": {
              "comment": {
                "ip": "172.28.173.136",
                "id": "63804260a0a9ba4487960881",
                "author": "demo-author",
                "blog_collection_id": "632c137a0fe5b42e60a04b62",
                "status": "unapproved",
                "body": "demo-content",
                "updated_at": "2022-08-03T10:45:00+08:00\t\n",
                "user_agent": "",
                "create_at": "2022-08-03T10:45:00+08:00\t\n",
                "published_at": "2022-08-03T10:45:00+08:00\t\n",
                "body_html": "<p>demo-content</p>",
                "email": "demo@qq.com",
                "blog_id": "63804260a0a9ba4487960881"
              }
            }
          },
          "examples": {
            "恢复删除的评论": {
              "value": {
                "comment": {
                  "blog_collection_id": "632c137a0fe5b42e60a04b62",
                  "updated_at": "2022-12-27T20:12:01+08:00",
                  "body": "fsf",
                  "email": "test@qq.com",
                  "blog_id": "63803d9ec57c9739b672296b",
                  "create_at": "2022-11-25T12:19:44+08:00",
                  "author": "testdew",
                  "id": "63804260a0a9ba4487960881",
                  "ip": "157.119.232.38,10.98.217.51",
                  "published_at": "2022-11-25T12:19:57+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/comments/:comment_id/restore.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"
  ]
}
```