deck icon indicating copy to clipboard operation
deck copied to clipboard

"POST /boards/{boardId}/undo_delete" API endpoint unexpected behavior

Open ESilva15 opened this issue 1 year ago • 0 comments

Hello, I'm trying to use the Deck API but have found an obstacle with the "undo_delete" endpoint. Which may or may not contain a problem in between the chair and the monitor.

I create a board, delete it and try to undo its deletion all with the same user.

Steps to reproduce:

curl -X POST 'https://username:[email protected]/index.php/apps/deck/api/v1.0/boards' \
  -H 'Accept: application/json' \
  -H "Content-Type: application/json" \
  -H 'OCS-APIRequest: true' \
   --data-raw '{"title":"A board","color":"FF00FF"}'

This will create the board and successfully return its data.

curl -X DELETE 'https://username:[email protected]/index.php/apps/deck/api/v1.0/boards/31' \
  -H 'Accept: application/json' \
  -H "Content-Type: application/json" \
  -H 'OCS-APIRequest: true'

Deletes the board as expected given the docs.

Now to undo that we would use:

curl -X POST 'https://username:[email protected]/index.php/apps/deck/api/v1.0/boards/31/undo_delete' \
  -H 'Accept: application/json' \
  -H "Content-Type: application/json" \
  -H 'OCS-APIRequest: true'

I would be expecting this to undo the board deletion but the reply I get from the server is the HTTP code 403. (curl also gives curl: (8) Weird server reply)

The board has the following permissions:

"permissions": {
  "PERMISSION_READ": true,
  "PERMISSION_EDIT": true,
  "PERMISSION_MANAGE": true,
  "PERMISSION_SHARE": true
},

Am I approaching this wrong? Is the user that created the board unable to undo its deletion?

Thanks

ESilva15 avatar Mar 15 '24 19:03 ESilva15