API Access for kanban

Hi,

We are trying to explore Kanban API’s. I have generated the personal access token and did base64 encoding as mentioned in documentation but every time I am getting 401 unauthorized.

Below is the curl command

curl -H ‘X-API-Auth:Token’ -d ‘{“jsonrpc”: “2.0”, “method”: “getAllProjects”}’ https://kanban.xxx.com/jsonrpc.php

Response:
{“jsonrpc”:“2.0”,“error”:{“code”:401,“message”:“Unauthorized”},“id”:null}

Can you please let me know what we are missing here ?

Can we only use API’s when we install the Kanban locally or it can be used when it is deployed on some server.

If you want to use a custom HTTP header for authentication, you have to configure your Kanboard instance accordingly. See https://docs.kanboard.org/en/latest/api/authentication.html#custom-http-header

This is optional.

You can still use the default HTTP Basic authentication mechanism.

For example:

curl -u example-user \
-d '{"jsonrpc": "2.0", "method": "getMyProjects", "id": 1}' \
http://kanban.example.org/jsonrpc.php