API for JSON data?

Hi, as someone with limited php skills, and being totally unfamiliar with Kanboard yet, I would like to explore the possibilites before diving into the matter. So, is it possible to extract project data from an external database tool, e.g. in JSON format or even csv, so that Kanboard can integrate it? E.g. by placing a data file in a specific location (easiest), or through a POST-Request? The only input will be new projects, no exchange of data whatsoever.
many thx, jo

Your description is somewhat vague. Of course, i’ts possible to create new projects and tasks via the Kanboard-API. But you’ll have to bring your data to JSON format first.
Please have a look at the API Reference.

great … I have started digging into it and yes, I really like the app. As I see it I have to call the createProject method in ProjectProcedure.php, just wondering HOW…any idea? Or is this the wrong approach? JSON format itsel is not a problem.

There are some examples in the docs.

EDIT: There was a similar request some time ago, might be helpful for you.

Yes, the API is quite simple and I personally like to use it. Just keep in mind that it’s not a REST(ful) API but a RPC API.

That means you have only one endpoint (jsonrpc.php) where you send POST requests (exclusively!) to. And in the body of the request you have to define the method name to call (hence the name RPC ~ remote procedure call) and the parameters that match to the method.

Example: opening a previously closed task

{
    "jsonrpc": "2.0",
    "method": "openTask",
    "id": 1888531925,
    "params": {
        "task_id": 1
    }
}

I just copied this example from the API docs. From the method attribute the API knows that you want to call the openTask procedure and this method needs to know the task ID, so this attribute is given in the params section.

All other methods work accordingly: send the method name and the params that are needed by that very method, that’s all.

Just ask if you have further questions.

… thx a lot! My problem is that I can’t pull the strings together yet…my (FileMaker) database application has its own formats of posting requests and also, as I have learned by now, curl has tons of options so I am still sorting things out.

However, there are on or two issues in the API format which I dont understand:

  • “id”: 1888531925" value pair in the example you posted… id of what, and how is it generated?
  • “jsonrpc” as some kind of general user entry: the password then is the API key, is that correct?

… so this is the result from the server which I am receiving:

{“jsonrpc”:“2.0”,“error”:{“code”:-32700,“message”:“Parse error”},“id”:null}.

:)jo

The id value is part of the JSON-RPC spec:

id
An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.

In my experience it doesn’t matter what value you use or if you use the same every time. You could set it to a timestamp for example.

For authentication you can use the jsonrpc default user. The API key is on the settings page.
Or you use your personal username either with the password or the created API key (My profile > API).

so this is the result from the server which I am receiving:

Never had that “Parse error”. Could you post your JSON request body?

1 Like

… and hey, it’s working! Your really kind support and a lot of trial and error helped me get rid of the mist in my head and in the end it turns out the solution is rather simple. Since most of this work had to be done within FileMaker I think it makes no sense to post the solution here, unless someone should ask for it, of course.
And the best: the online Kanboard display refreshes automatically :slight_smile:

So for now, many many thanks guys!!
Joachim

I wasn’t aware of this. I always use the number from the API-Reference.