An open client for the OpenProject API
$ dotnet add package auxua.OpenProjectTo connect to an OpenProject instance and interact with its REST API, you can use this package.
It is based on the v3 API of OpenProject and .Net Standard 2.0.
Key to usage is the Base Adress and an API Key. You can get the API Key from your OpenProject profile settings.
var config = new BaseConfig()
{
PersonalAccessToken = Settings.ApiKey,
BaseUrl = Settings.ApiBaseUrl
};
var client = new auxua.OpenProject.OpenProjectClient(config);
For example, to get a list of projects:
var projects = await client.Projects.GetProjectsAsync();
Or getting the according work packages:
var query = WorkPackageQuery.ForProject(id);
var wp = await client.WorkPackages.GetWorkPackagesAsync(query);
var wp2 = await client.WorkPackages.GetAllWorkPackagesAsync(query);
For more details of work packages, you may want to create the facade, which catches additional information in the background:
var testwp = wp2.Where(x => x.Subject == "Test Work Package").First();
var ftest = new WorkPackageFacade(testwp, client.CustomFields);
| Read / Get | Write (Create/Update/Delete) | |
|---|---|---|
| Activities | ✅ | - |
| Attachments | ⭕ | ⭕ |
| News | ✅ | ✅ |
| Notifications | ✅ | ✅ (Mark [Un]Read) |
| Projects | ✅ | ⭕ |
| Relations | ✅ | ✅ |
| Time Tracking | ✅ | ✅ (Create) |
| Users | ✅ |
| - |
| Version | ✅ | ✅ |
| WorkPackages | ✅ | ✅ |
| WorkPackage Types | ✅ | - |
| WorkPackage Custom Fields | ✅ | - |
| Work Package Custom Options | ⚠️ (incomplete) | - |
This project is open for issues and contributions. Feel free to open issues on GitHub or submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.