python-api-client icon indicating copy to clipboard operation
python-api-client copied to clipboard

401 no matter what I do, I can get it to work with curl

Open vecst opened this issue 1 year ago • 1 comments
trafficstars

I cannot get the API to connect to my kanboard. Everything I've tried leads me to a 401, except using curl. Curl only works if I use X-API-Auth. I don't know how to use custom headers with python API. Please help me. I'll provide any info needed

vecst avatar Sep 18 '24 19:09 vecst

I was able to get it figured out, well a friend helped me. There's an optional 4th parameter that seems to be missing any documentation that lets you set the header type.

vecst avatar Sep 19 '24 14:09 vecst

Note that I've also had trouble making it work just following the doc; what I ended up was something like this:

kc = kanboard.Client(...)
kc.execute(
    method='createTask',
    project_id=1,
    title="hello",
    description="world",
)

and using method names and arguments from the API documentation, eg. this page for createTask: https://docs.kanboard.org/v1/api/task_procedures/#createtask

I suspect the doc could be improved, but knowing that this is a low-maintenance project I don't expect author to fix it; maybe if someone came up with concrete MR.

AloisMahdal avatar Dec 13 '24 11:12 AloisMahdal

There is an example in the project readme to use a custom authentication header if that still needed: https://github.com/kanboard/python-api-client#use-a-custom-authentication-header

fguillot avatar May 18 '25 00:05 fguillot