删除文章

基本信息

接口名称: 删除文章

接口类型: 数据删除

接口说明: 删除文章

详细信息

URL

https://www.baklib.com/api/v1/articles/:id

完整URL示例

https://www.baklib.com/api/v1/articles/039daad3-526d-48c0-b296-d7814df8d86a?tenant_id=aaa24dbe-a17b-4439-911d-176e0149cf76

HTTP请求方式

DELETE

授权认证方式

默认方式,需要添加请求header

Authorization: Bearer <token>

请求参数

参数 必选 类型及范围 说明
id true String 文章id
real false Boolean 是否彻底删除,默认为false。
tenant_id true String 站点id

示例代码


var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://www.baklib.com/api/v1/articles/?039daad3-526d-48c0-b296-d7814df8d86a?tenant_id=aaa24dbe-a17b-4439-911d-176e0149cf76");
xhr.setRequestHeader("Authorization", "Bearer 8486df9cb8a93ea843702141065c4a8b714602b45e7c4a6bb26a26ea3d69de6");


xhr.send();

返回结果

{
  "code": 0,
  "status": "success",
  "message": "成功"
}

返回字段说明

返回值字段 字段类型 说明
code Integer 状态码
status String 返回状态
message String 返回信息
2022-11-18
0 0