Coder Social home page Coder Social logo

Request Planka API with cURL about planka HOT 2 CLOSED

staze0 avatar staze0 commented on June 25, 2024
Request Planka API with cURL

from planka.

Comments (2)

meltyshev avatar meltyshev commented on June 25, 2024 1

Hi! I've just tried to create a card and this worked for me:

curl -X POST -H 'Authorization: Bearer TOKEN' -d 'name=test&position=123' http://localhost:1337/api/lists/869469508069229768/cards

5. Request to create a card regarding the routes defined here (ecc45c7/server/config/routes.js) / Result : NOK

curl.exe -X POST -H "Authorization: Bearer TOKEN" https://FQDN/api/boards/1202247906392802324/cards/
{"code":"E_NOT_FOUND"}

You seem to be referring to a 2 year old commit, the actual routes are here: https://github.com/plankanban/planka/blob/master/server/config/routes.js.

11. Finally when I try to get infos on this list with the endpoint /api/lists/<listId> I am getting this

curl.exe -X GET -H "Authorization: Bearer TOKEN" https://FQDN/api/lists/1202252203985732663
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="https://FQDN.be/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Planka is an open source project management software"/><link rel="apple-touch-icon" href="logo192.png"/><link rel="manifest" href="https://FQDN.be/manifest.json"/><title>Planka</title><script defer="defer" src="https://FQDN.be/static/js/main.1c3bb07c.js"></script><link href="https://FQDN/static/css/main.86a2be8a.css" rel="stylesheet"></head><script>window.BASE_URL="https://FQDN"</script><body id="app"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

There is no such endpoint, all lists can be retrieved by querying the entire board. But we've already added it in the v2 :)

from planka.

staze0 avatar staze0 commented on June 25, 2024 1

Hello @meltyshev

Thank you for your time and explanation. I step back and realize that even if my account was "Project Manager" of the project, he was not able to do anything on boards. After I add the rights to modify on boards, I was able to do what I want to do with cURL and web requests.

In conclusion, I consider my problem as resolved but maybe the error message need to be modify to specify that rights is not good because here I had an error message that the listId does not exist. It is purely details but if I had a message like "Your user do not have right to modify board/lists/whatever", I figured out the solution much faster.

Thanks again.

from planka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.