Improve REST webservice call syntax
Closed
Improve REST webservice call syntax
Some calls to REST webservices can be improved.
For the moment, I noticed:
- the dateOfBirth syntax expected in modification is different from the syntax when reading the attribute
- the userPassword attribute can be read but not modified
For user password:
curl -H 'Session-Token: koo5cmma2kt1915k9qthjm6ef2' -X PUT -d '"test"' 'https://fd.pfptnbdev.io/rest.php/v1/objects/user/uid=coudot,ou=users,dc=kroqi,dc=fr/user/userPassword'
[{"message":"Le champ obligatoire 'Mot de passe' n'est pas rempli\u202f!","line":44,"file":"\/usr\/share\/fusiondirectory\/include\/webservice\/class_fdRPCService.inc"
Even a user creation fails:
cat fd-rest-new-account.json
{ "attrs": { "user": { "givenName": "Baptiste", "sn": "TEST", "userPassword": "test" }, "mailAccount": { "mail": "baptiste.gaillet@test.fr" }, "personalInfo": { "personalTitle": "Monsieur", "fdBadge": "16" } }, "template": "ou=users,dc=kroqi,dc=fr"}
curl -X POST -d @fd-rest-new-account.json -H "Session-Token: koo5cmma2kt1915k9qthjm6ef2" https://fd.pfptnbdev.io/rest.php/v1/objects/user
[{"message":"Le champ obligatoire 'Mot de passe' n'est pas rempli\u202f!","line":44,"file":"\/usr\/share\/fusiondirectory\/include\/webservice\/class_fdRPCService.inc"