|
|
|
### Howto add/modify a multivaluated attribute of an user
|
|
|
|
|
|
|
|
#### Login
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -X POST "http://192.168.56.100/fusiondirectory/rest.php/v1/login" --data '{
|
|
|
|
"user": "fd-admin",
|
|
|
|
"password": "tester"
|
|
|
|
}' | jq .
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
|
100 77 100 29 100 48 366 606 --:--:-- --:--:-- --:--:-- 600
|
|
|
|
"61o9679ov4741a2shgs7afpb70"
|
|
|
|
```
|
|
|
|
### Get user informations (before add/update)
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -X GET -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/objects/user/uid=toto,ou=people,dc=my-domain,dc=com" | jq .
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
|
100 467 100 467 0 0 6846 0 --:--:-- --:--:-- --:--:-- 6867
|
|
|
|
{
|
|
|
|
"cn": "tgn tsn",
|
|
|
|
"sn": "tsn",
|
|
|
|
"givenName": "tgn",
|
|
|
|
"description": "",
|
|
|
|
"jpegPhoto": "",
|
|
|
|
"l": "",
|
|
|
|
"st": "",
|
|
|
|
"postalAddress": "",
|
|
|
|
"roomNumber": "",
|
|
|
|
"telephoneNumber": "",
|
|
|
|
"mobile": "",
|
|
|
|
"pager": "",
|
|
|
|
"facsimileTelephoneNumber": "",
|
|
|
|
"labeledURI": "",
|
|
|
|
"base": "dc=my-domain,dc=com",
|
|
|
|
"uid": "toto",
|
|
|
|
"preferredLanguage": "",
|
|
|
|
"userPassword": "totopassword",
|
|
|
|
"displayName": "",
|
|
|
|
"homePostalAddress": "",
|
|
|
|
"homePhone": "",
|
|
|
|
"title": [],
|
|
|
|
"o": "",
|
|
|
|
"ou": "",
|
|
|
|
"departmentNumber": "",
|
|
|
|
"employeeNumber": "",
|
|
|
|
"employeeType": "",
|
|
|
|
"manager": ""
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Set multivaluated attribute
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -X PATCH -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/objects/user/uid=toto,ou=people,dc=my-domain,dc=com/user/title" --data '["mytitle"]' | jq .
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
|
100 11 0 0 100 11 0 96 --:--:-- --:--:-- --:--:-- 97
|
|
|
|
```
|
|
|
|
|
|
|
|
### Get user informations (checking after)
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -X GET -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/objects/user/uid=toto,ou=people,dc=my-domain,dc=com" | jq .
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
|
100 467 100 467 0 0 6846 0 --:--:-- --:--:-- --:--:-- 6867
|
|
|
|
{
|
|
|
|
"cn": "tgn tsn",
|
|
|
|
"sn": "tsn",
|
|
|
|
"givenName": "tgn",
|
|
|
|
"description": "",
|
|
|
|
"jpegPhoto": "",
|
|
|
|
"l": "",
|
|
|
|
"st": "",
|
|
|
|
"postalAddress": "",
|
|
|
|
"roomNumber": "",
|
|
|
|
"telephoneNumber": "",
|
|
|
|
"mobile": "",
|
|
|
|
"pager": "",
|
|
|
|
"facsimileTelephoneNumber": "",
|
|
|
|
"labeledURI": "",
|
|
|
|
"base": "dc=my-domain,dc=com",
|
|
|
|
"uid": "toto",
|
|
|
|
"preferredLanguage": "",
|
|
|
|
"userPassword": "totopassword",
|
|
|
|
"displayName": "",
|
|
|
|
"homePostalAddress": "",
|
|
|
|
"homePhone": "",
|
|
|
|
"title": [
|
|
|
|
"mytitle"
|
|
|
|
],
|
|
|
|
"o": "",
|
|
|
|
"ou": "",
|
|
|
|
"departmentNumber": "",
|
|
|
|
"employeeNumber": "",
|
|
|
|
"employeeType": "",
|
|
|
|
"manager": ""
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Logout
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -X POST -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/logout" | jq .
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
|
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
|
|
|
|
``` |
|
|
|
\ No newline at end of file |