Help for new parametre api

can we add a parameter in the api?
I would like to have a file number, I added a “number” column in the “task” database but if I do:

{“jsonrpc”: “2.0”, “method”: “createTask”, “id”: 1176509098, “params”: {“id”: 58,“number”:“425”,“title”:“$title” }

the number column
does not fill it remains in null

yes you can do it, but you need to write the api procedures to handle it.

here is an example of a plugin that has added api procedures for reference

thank you for your reply.
I don’t quite understand how the plugin works.
is it not possible to add a parameter for this “createTask” method?
because I only use this method in api

here is the current procedure

if you want to edit the base code, go for it.

thank you it works wonderfully it fits well in my database with the api call :wink:

another quick question.
I am trying to display the file number instead of the ID
I did find this:

<div class="dropdown">
    <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong>#<?= $task['id'] ?> <i class="fa fa-caret-down" ></i></strong></a>
    <ul

but if i change the $task[‘id’] to $task[‘color_id’] it works.

but if i change to task[‘number’]
I have an error undefined

adding columns is only 1 step. you have not accounted for getting the data from the column.

Models are the gateway to the database.

i dont have enough information to tell you which model and respective function is being used here, since i dont know what template that is. I’d guess its the TaskFinderModel.

I’m going along with this, because experimenting is fun and a good way to learn, but KB comes with a built in metadata…so the procedures to do what you wanted were indeed already built in to KB, it still would require a bit of coding, but you could have just used the taskMetadata functions to do this.

Albeit, there is not a lot of info on these in the docs. (it might have also gotten a bit confusing in the api procedure for you, so maybe this is the better way for you in the short run) But you should look into that more.

really, thank you, :clap: :+1:
That’s exactly what I wanted.
I added the “number” lines to the TaskFinderModel file
and everything works I have no more errors and my numbers are displayed

                        TaskModel::TABLE.'.color_id',
                        TaskModel::TABLE.'.number',
1 Like