nitinkg
(Nitin Gupta)
1
您好,
我尝试通过 API 删除一个草稿:
DELETE /drafts/{draft_key}.json
该草稿确实存在(已通过 GET /drafts.json 验证),并且我使用了正确的 draft_key 和 sequence。
API 请求(Postman / 后端)
DELETE https://<base_url>/drafts/{draft_key}.json
请求头:
Api-Key: <api_key>
Api-Username: <username>
Content-Type: application/x-www-form-urlencoded / application/json
请求体(两种格式都尝试过):
x-www-form-urlencoded:
draft_key=new_topic_xxxxx
sequence=12
或原始 JSON:
{
"draft_key": "new_topic_xxxxx",
"sequence": 12
}
响应
{
"errors": ["The requested URL or resource could not be found."],
"error_type": "not_found"
}
从 UI 界面(正常工作)
通过浏览器使用以下方式可以成功删除:
问题
是否支持通过 API Key 认证进行草稿删除,与其他 API 一样?如果支持,调用此端点的正确方式是什么?
谢谢。
你试过在查询参数中也传递用户名吗?(即在 URL 末尾添加 ?username=<用户名>)
看来我们在没有提供 username 查询参数时,允许 API 回退到 Api-Username 用户名的方式不够一致。
这个问题应该已在以下提交中修复: