multisite - Blocks Rest API rest_cannot_delete

I'm trying to make a Postman call to the Wordpress API to delete a block. However, I keep getting a 403. This user

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'

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745294714a4621068.html

相关推荐

  • multisite - Blocks Rest API rest_cannot_delete

    I'm trying to make a Postman call to the Wordpress API to delete a block. However, I keep getting a 403. This user

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信