This documents This 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:
Resource | METHOD | Description |
---|---|---|
/node/logins | GET | 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 | Get login statistics for projects for the given time period, grouped by type of client used(Revit, dRofus etc.) |
/node/unique_users | GET | 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 | GEt | 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 | Get |
statstics values on projects, to_date and from_date are optional limits on date | ||
/password/request_reset | GET | A post request with a valid username will trigger a password reset email |
/password/reset | GET | Use this with a token to change password with the API |
/owners/[id]/tasks/[TaskName]/run?source=[sourcedb]©_ids=[ids] | POST | Run a given task against all databases for 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 | ?qquery=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" } |
...
Parameter | Descriptione |
---|---|
project_user | project_id: ID of the project to add to room_rights: room permission level equipment_rights tender_rights consignation_rights system_rights modelstore_rights superuser. Project administrator addon_admin: BIM admin no_web_admin_access: if user is superuser, this denies the access to the web admin hide_price: true or false should the user see prices |
user | username: Username of the user to add first_name: First name of the user to add last_name: Last name of the user to add email: Email of the user to add If the user exists, make sure that the information given is equal to the information registred on the server |
mail_type | ID of the email to send to the user (from /emails), "skip_email" means no email will be sent. |
GET Resources: Object manipulation and more
...