Create a user
To create a user with the REST-interface using curl on the command line:
curl -u admin:password -H "Content-Type: application/json" --data @/tmp/newuser http://localhost:9080/syncope/rest/user/create.json
Where:
- /tmp/newuser is a file containing the definition of the user to create, see below
- admin:password is the username:password combination for accessing the core. (admin/password is default)
- Syncope core runs on localhost:9080/syncope
The file /tmp/newuser could look like this:
{ "id": "0", "username": "myusername", "password": "test123", "attributes" : [ { "schema": "userId", "values": ["example1@example.com"] }, { "schema": "surname", "values": ["My Surname"] } ] }
To link the user to an existing resource, include this in the root json hash:
"resources" : [ "ws-target-resource-1" ]
Export database content
curl -u admin:password -o content.xml -H "Content-Type: application/xml" -X GET http://localhost:9080/syncope/cxf/configurations/stream
Change configuration value
curl -u admin:password -H "Content-Type: application/json" \
-d '{"key":"smtp.host","value":"smtp.ngi.it"}' http://localhost:9080/syncope/rest/configuration/update.json