|
|
## FusionDirectory REST Webservice
|
|
|
|
|
|
### Authentification methods
|
|
|
|
|
|
#### 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"
|
|
|
```
|
|
|
|
|
|
### Retrieve token
|
|
|
|
|
|
```bash
|
|
|
$ curl -X GET -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/token" | jq .
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
100 29 100 29 0 0 536 0 --:--:-- --:--:-- --:--:-- 547
|
|
|
"61o9679ov4741a2shgs7afpb70"
|
|
|
```
|
|
|
|
|
|
## Objets
|
|
|
|
|
|
### Listing users
|
|
|
|
|
|
```bash
|
|
|
$ curl -X GET -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/objects/user" | jq .
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
100 58 100 58 0 0 956 0 --:--:-- --:--:-- --:--:-- 966
|
|
|
{
|
|
|
"uid=fd-admin,ou=people,dc=my-domain,dc=com": "fd-admin"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
### Create user
|
|
|
|
|
|
```bash
|
|
|
$ curl -X POST -H "Session-Token: 61o9679ov4741a2shgs7afpb70" "http://192.168.56.100/fusiondirectory/rest.php/v1/objects/user" --data '{ "attrs": { "user": { "uid": "toto", "sn": "tsn", "givenName": "tgn", "userPassword": "totopassword" } } }' | jq .
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
100 148 100 41 100 107 418 1092 --:--:-- --:--:-- --:--:-- 1103
|
|
|
"uid=toto,ou=people,dc=my-domain,dc=com"
|
|
|
``` |
|
|
\ No newline at end of file |