admin管理员组文章数量:1418699
I'm trying to make a Postman call to the Wordpress API to delete a block.
However, I keep getting a 403
. This user is used to add and delete pages, tags, and posts just fine using the Application Passwords
Plugin for authentication. The user is an Administrator
.
I have no idea why I don't have permissions. I can delete in the UI.
I suspect I am not adding a needed parameter to the creation call such as context or a template. But I don't know what values those should be. I hope someone here as experience with using Blocks in the REST API.
ERROR:
{
"code": "rest_cannot_delete",
"message": "Sorry, you are not allowed to delete this post.",
"data": {
"status": 403
}
}
I'm deleting these blocks using the API with a call like this:
curl -X DELETE \
'http://<IP_ADDRESS>/<SUBSUTE>/wp-json/wp/v2/blocks/59?force=1' \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Basic <Token>' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: ' \
-H 'Host: <IP>' \
-H 'Postman-Token: <TOKEN>' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'cache-control: no-cache'
I'm creating these blocks using the API with a call like this:
curl -X POST \
'http://<SITE>/<SUBSITE>/wp-json/wp/v2/blocks?title=BLOCKS%20TITLE&content=BLOCKS%20CONTENT' \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Basic <TOKEN>' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: ' \
-H 'Host: <IP>' \
-H 'Postman-Token: <TOKEN>' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'cache-control: no-cache'
本文标签: multisiteBlocks Rest API restcannotdelete
版权声明:本文标题:multisite - Blocks Rest API rest_cannot_delete 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745294714a2652004.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论