Open utarasama opened 2 months ago
@utarasama Inside Dolibarr, follow this trail Home, Admin tools, About Dolibarr - and you can find all the version information.
@JonBendtsen Thanks!! I edited my initial message with the missing informations.
I sort of see what you mean with regards to request_data.
When I developed my system for dance class registrations and I also create thirdparties what I did was use the regular Dolibarr GUI to make some thirdparties, and then I used GET thirdparties to get some json which I then modified a little and sent back to Dolibarr with a POST until I understood the correlation between the input json and the results I got inside Dolibarr GUI was precisely as I expected.
Bug
I tried to create a thirdparty throught the POST request
/thirdparties
. The swagger suggested me to fill the request body with this type of data :Since I want to provide multiple informations, I used to do it like this with other APIs :
I get a 400 error "missing name field" error when I try to respect the swagger recommendations. However, when I tried like I used to do, the request worked successfully. I was able to create a thirdparty.
So, what I request from this issue is to edit the swagger documentation to tell the user something like "hey! Use this data formalism". Moreover, I checked the
api_thirdparties.class.php
file and can't understand what is the purpose of the$request_data
variable, since I can just forget it to make my request work.Furthermore, I didn't check but I think this problem might also be in the documentation of other requests.
Dolibarr Version
19.0.1
Environment PHP
8.2.7
Environment Database
PostgreSQL 16.2
Steps to reproduce the behavior and expected behavior
Just try to put your thirdparty data into the
request_data
JSON string array, and nothing elsewhere. You will get the error.To not get it, forget the
request_data
key and just use the formalism from the GET /thirdparties request. You must specify at least the thirdparty's name to make it work.Attached files
No response