This documents the possibility to interact with the admin system using REST calls (GET, POST, PUTThis documents the possibility to interact with the admin system using REST calls (GET, POST, PUT, PATCH, DELETE) allowing automation of tasks like creating projects and users.
...
Code Block |
---|
curl -s -u testadmin:testpw http://[admin-url]/users/hakonhc.json |
Resources:
ResouceResource | Description |
---|---|
/projects | Lists and manipulation of projects |
/owners | Listing of project owners |
/users | Listing and manipulation of users on the server |
/database | Listing and manipulation of databases |
/project_users | Listing and manipulation of users in projects |
...
In addition we have some special endpoint for:
Resouce
date are optional limits on date/password/request_reset A post request with a valid username will trigger a password reset email /password/reset Use this with a token to change password with the API
Resource | Description |
---|---|
/node/logins | Get login statistics for projects for the last 5 years, grouped by type of client used(Revit, dRofus etc.) |
/node/logins?from_date=2018-01-01&to_date=2019-12-31 | Get login statistics for projects for the given time period, grouped by type of client used(Revit, dRofus etc.) |
/node/unique_users | Gets number of unique users for each project for the last 5 years |
/node/unique_users?from_date=2018-01-01&to_date=2019-12-31 | Gets number of unique users for each project for the given period. |
/project_data?from_date=2018-01-01&to_date=2019-12-31 | Get statstics values on projects, to_date and from_ |
date are optional limits on date | |
/password/request_reset | A post request with a valid username will trigger a password reset email |
/password/reset | Use this with a token to change password with the API |
/owners/[id]/tasks/[TaskName]/run?source=[sourcedb]©_ids=[ids] | POST request to run given task against all databases in a given owner. TaskName is one of the following
|
GET Resources: Listings
Resource | Description | Parameters |
---|---|---|
/projects | List all projects | ?query=xx will list all projects contaning xx in the name ?show_all=1 to also include inactive projects |
/projects/1 | List project with id 1 | |
/owners | List all owners | |
/owners/1 | List owner with id 1 | |
/users | List of all users | ?query=xx to search |
/users/username | List user with username | |
/database | List databases | |
/project_users/username,projectid | Show project user |
...
Code Block |
---|
$ curl -H "Accept: application/json" -H "Content-type: application/json; charset=UTF-8" -X POST -u testadmin:testpw -d @data.json http://[admin-url]/project_users {"project_user":{"created_at":"2016-11-28T12:22:35Z","project_id":408,"role":null,"superuser":null,"user_role_id":null,"username":"hakonhc"}} |
Wherer Where data.json contains
Code Block |
---|
{ "project_user": { "project_id": 408,"room_rights":1 }, "user": {"username": "hakonhc", "first_name":"Håkon","last_name":"Clausen","email":"hhc@drofus.com"}, "mail_type": "6" } |
...