Deck REST API authentication from external webhook

I am new to the Nextcloud Deck APIs, so please bear with me. I want to connect the forms on a website via webhook with the Deck app, so a new form submission creates a new card in Deck.
I have no issue setting up the correct parameters, however I am wondering what kind of authentication is needed to make it possible to actually use an external webhook like this? I couldn’t find any examples in the docs for this REST API and was wondering how you achieve this?

Hi,

the REST API requires HTTP basic authentication for the user who should perform the actions. This can be then either the user password or a generated app password that you can create in the security settings of the Nextcloud user account.

Hope this helps.

Let me know if you have any further questions.

Thanks, I’ve tried it with the Basic Authentication with the user/password combo but the only message I get back is “Method not allowed”. This is my POST request URL:

https://cloud.mynextclouddomain.de/index.php/apps/deck/api/v1.1/board/4/stacks/16/cards

I’ve added to the request header:

'OCS-APIRequest' : true
'Authorization': Basic [base64 encrypted user:password]

and in the request body: title, type and order

Seems like there is a typo in the request URL board should be boards. Here would be an example using curl that should work:

curl -X POST http://nextcloud.dev.local/index.php/apps/deck/api/v1.1/boards/1/stacks/1/cards \
    -d "title=asd" -d "type=plain" -d "order=1" \
    -u admin:admin

oh dear lord I feel stupid now :see_no_evil: now it works like a charm! Thank you!

1 Like

hi, i have windows curl an want create new board and card from powershell. I use this, but no luck:

curl --request POST https://cloud.local1.com/index.php/apps/deck/api/v1.1/boards --data “title=nameofcard” --user username:password

get error in powershell:
Invoke-WebRequest : A positional parameter cannot be found that accepts argument ‘POST’.
At line:1 char:1

  • curl --request POST https://cloud.plastex.sk/index.php/apps/deck/api/
  •   + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    
    
    

my goal is to create all from windows command line

ok, do some homework. so first, must use cmd, not powershell.

i created board with this command>
curl -X POST https://cloud.local1.com/index.php/apps/deck/api/v1.1/boards --data “title=nameofboard” --data “color=ff0000” --user username:password

but how to get latest id of boards or better how to use board name and not boardId in link when i want POST new stacks/cards ?