Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

ResouceResourceDescription
/projectsLists and manipulation of projects
/ownersListing of project owners
/usersListing and manipulation of users on the server
/databaseListing and manipulation of databases
/project_usersListing and manipulation of users in projects

...

In addition we have some special endpoint for:

ResouceDescription
ResourceMETHODDescription
/node/loginsGETGet 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-31GETGet login statistics for projects for the given time period, grouped by type of client used(Revit, dRofus etc.)
/node/unique_usersGETGets number of unique users for each project for the last 5 years
, grouped by type of client used(Revit, dRofus etc.)/node/logins
/node/unique_users?from_date=2018-01-01&to_date=2019-12-31GEtGets number of unique users for each project for the given period.
/project_data?from_date=2018-01-01&to_date=2019-12-31GEtGet
login statistics for projects for the given time period, grouped by type of client used(Revit, dRofus etc.)/node/unique_usersGets number of unique users for each project for the last 5 years/node/unique_users?from_date=2018-01-01&to_date=2019-12-31Gets number of unique users for each project for the given period./project_data?from_date=2018-01-01&to_date=2019-12-31Get statstics values on projects, to_date and from_date are optional limits on date/password/request_resetA post request with a valid username will trigger a password reset email/password/resetUse this with a token to change password with the API
statstics values on projects, to_date and from_date are optional limits on date
/password/request_resetGETA post request with a valid username will trigger a password reset email
/password/resetGETUse this with a token to change password with the API
/owners/[id]/tasks/[TaskName]/run?source=[sourcedb]&copy_ids=[ids]POST

Run a given task against all databases for a given owner. TaskName is one of the following

  • CopyOverwriteExcelExportsTask: Copy given excel export identified by ids from sourcedb to all other dbs
  • CopySharedRdlReports: Copy given RDL reports identified by ids from sourcedb to all other dbs

GET Resources: Listings

ResourceDescriptionParameters
/projectsList all projects

?query=xx will list all projects contaning xx in the name

?show_all=1 to also include inactive projects

/projects/1List project with id 1
/ownersList all owners
/owners/1List owner with id 1
/usersList of all users?qquery=xx to search
/users/usernameList user with username
/databaseList databases
/project_users/username,projectidShow 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"
}

...

ParameterDescriptione
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_typeID of the email to send to the user (from /emails), "skip_email" means no email will be sent.

GET Resources: Object manipulation and more

...