Hi,
I was running some tests with the datasets to see how they work and what could I use them for.
Unfortunatly, I was just able to create a dataset, and add columns with their correct parameters. The problem appears when I try to add a row to a dataset. (Also don’t mind names I gave as parameters, just put the first this that came to my mind)
-
With POST /dataset/data
(upload://ljoR67Bm1EB5Khml4KKvy3JpHn7.png)
When using this function like this :
it gives me that result :
Pretty obvious, but as the createRow function ask for strings and not arrays, what’s the correct way to do it ? -
With POST /dataset/importjson
After struggling for a long long time with the function above, I tried creating the importJSON function, that exists in the swagger documentation, but not in the code. It looks like this :
Which gives me : malformed json body, rows and unique keys are required
Here is the JSON array I was giving to the function :VALID JSON (RFC 4627) Formatted JSON Data { "uniqueKeys":[ "repas" ], "rows":[ { "repas":"Yes", "prix":"2.00", "image":"51" }, { "repas":"Test", "prix":"10.00", "image":"51" } ] }
-
With PUT /dataset/data
I told myself “if the row is created, then I just have to edit it and I’ll be able to add the values I want in that row ?”… So here’s the code :
Again, didn’t work, here’s the result :
I’ve seen many topics on that error, but none of the given solutions helped me resolve it.
I also tried all 3 “solutions” within postman : the 1st one didn’t work, but the 2nd one with the json string worked.
EDIT : managed to make this work, but still can’t figure it out with the PHP library :