英文:
Directus delete Item by ID
问题
在Directus中通过API删除项目的方式如下:
DELETE /items/:collection/:id
我尝试了这个方法,但只收到了一个错误信息:
DELETE /items/parking_reservations/61
"errors": [
{
"message": "\"value\" must contain at least one of [query, keys]",
"extensions": {
"code": "FAILED_VALIDATION"
}
}
]
英文:
How can you delete a item via Api in Directus?
According to the doku the path would be:
> DELETE /items/:collection/:id
I tried this but only got an error:
> DELETE /items/parking_reservations/61
"errors": [
{
"message": "\"value\" must contain at least one of [query, keys]",
"extensions": {
"code": "FAILED_VALIDATION"
}
}
]
答案1
得分: 1
你可以使用Directus中的API通过DELETE方法删除一个项目。您可以通过向items端点发送带有项目ID的请求来执行此操作。例如,如果您想删除ID为42的项目,您可以向以下端点发送DELETE请求:/api/1.1/tables/<table_name>/rows/42。
英文:
You can delete an item via the API in Directus using the DELETE method. You can perform this action by sending a request with the item's id to the items endpoint. For example, if you wanted to delete an item with the id of 42, you would send a DELETE request to the following endpoint: /api/1.1/tables/<table_name>/rows/42.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论