Ok, let’s proceed under the assumption that you have your dataset with all columns etc already set up.
In API you will first want to know your columnsId ie you will use the following call
{{url}}/api/dataset/59/column
Where 59 is my dataSet id (visible in web ui as well, if you do not know your dataSet Id you can use the GET dataset call first).
Example response of the call above:
[
{
"dataSetColumnId": 135,
"dataSetId": 59,
"heading": "Date",
"dataTypeId": 1,
"dataSetColumnTypeId": 1,
"listContent": null,
"columnOrder": "1",
"formula": null,
"dataType": "String",
"dataSetColumnType": "Value"
},
{
"dataSetColumnId": 136,
"dataSetId": 59,
"heading": "Location",
"dataTypeId": 1,
"dataSetColumnTypeId": 1,
"listContent": null,
"columnOrder": "2",
"formula": null,
"dataType": "String",
"dataSetColumnType": "Value"
},
{
"dataSetColumnId": 137,
"dataSetId": 59,
"heading": "Description",
"dataTypeId": 1,
"dataSetColumnTypeId": 1,
"listContent": null,
"columnOrder": "3",
"formula": null,
"dataType": "String",
"dataSetColumnType": "Value"
},
{
"dataSetColumnId": 138,
"dataSetId": 59,
"heading": "Time",
"dataTypeId": 1,
"dataSetColumnTypeId": 1,
"listContent": null,
"columnOrder": "4",
"formula": null,
"dataType": "String",
"dataSetColumnType": "Value"
}
]
Now, we know all the dataSetColumnId we need, so we proceed to the next call (add row):
{{url}}/api/dataset/data/59
Where 59 is, again, my datasetId.
In the body of this call you need to pass parameters for each column that should have some value in this row, you do not need to pass value to every available column if you don’t want to you can even don’t pass any parameters at all it will then just add an empty row to the dataSet.
As you can see in the code response above my columns have the Ids 135,136,137 and 138
The body of this call in my example will look like this:
In a response you will see (in this example):
{
"id": 4
}
Which is the rowId of the row that I’ve just added.
Now if we look in the datasets in web ui, you will see the following:
Which means that I’ve successfully added a new row with the required values via API call.
If you want to edit existing row in the dataSet, then again you’d need to GET the rowId
and then use PUT /dataset/data/{dataSetId}/{rowId}
call with the same logic as shown above for POST row call.
Hope that helps.