Versions Compared

Key

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

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:

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:

Resouce
ResourceDescription
/node/loginsGet 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-31Get 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
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
/owners/[id]/tasks/[TaskName]/run?source=[sourcedb]&copy_ids=[ids]

POST request to run given task against all databases in 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?query=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"
}

...