Stable | Beta | Alpha |
---|---|---|
The FactroApiClient is a simple API wrapper written in C# to interact with the Factro REST API.
Disclaimer: This project is in a very early stage of development. That means that some features are not (completely) implemented yet.
You may visit the Milestones page to get more information on the progress.
Each milestone summarizes tasks, activities and the progress of its functionality.
The AppointmentAPI milestone contains everything related to the Appointment API
.
Factro is a project management software by Schuchert Managementberatung GmbH & Co. KG.
This client implements the functionalities of the REST API to provide an easier way to interact with the API.
All features are listed in the APIs documentation.
There are three GitHub Projects to visualize and organize the progress of this project. The tasks are represented as issues to simplify the tracking and organizing of tasks in the roadmap.
- Roadmap contains all issues (tasks and feature requests).
- Development contains all pull requests.
- Bug Tracker contains all bug tickets.
All issues are linked to their milestone. These milestones contain every issue and pull request that is related to this milestone.
The CI generates a GitHub-Release everytime a pull request is merged into develop
(alpha release), beta
(beta release) or main
(stable release).
With every release there is a new GitHub-Package pushed to the Packages page of this repository.
This packages can be installed via nuget or a by downloading the .nupkg
file from a Release. (Getting started)
Bugs can be reported by creating an issue from the bug report template.
Features can be requestd by creating an issue from the feature request template.
To get an example of how the package can be consumed, you may take a look at the FactroApiClient.Integration project.
To install the package, the custom feed is needed. This feed can be added via the Nuget.config file or the .NET CLI.
Config file
Create a new file called nuget.config
(this name is case insensitive).
The content of the file should have following structure:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="github" value="https://nuget.pkg.github.com/timoheller99/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="GITHUB_USERNAME" />
<add key="ClearTextPassword" value="GITHUB_TOKEN" />
</github>
</packageSourceCredentials>
</configuration>
.NET CLI
dotnet nuget add source "https://nuget.pkg.github.com/timoheller99/index.json" -n "github" -u "GITHUB_USERNAME" -p "GITHUB_TOKEN" --store-password-in-clear-text
- Replace
GITHUB_USERNAME
with your GitHub username. - Replace
GITHUB_TOKEN
with your GitHub token.
After adding the feed to your nuget sources you have access to the package.
You can now add the package to your project.
<ItemGroup>
<PackageReference Include="FactroApiClient" Version="1.0.0" />
</ItemGroup>
To use the package, you don't theoretically have to use dependency injection.
Unfortunately there is currently no support for using this package without dependency injection, but it's planned. (There are some hacky procedures and workarounds but it should be supported natively of course ;) )
You have to store you Factro API token to pass it to the client. You can store the token in a config file or via environment variables.
Config file
{
"FactroApiClient":
{
"ApiToken": "YourFactroApiToken"
}
}
Environment variable
export FactroApiClient__ApiToken="YourFactroApiToken"
You have to create a IConfigurationRoot
to get the API-Token from the config file or the environment variables.
private static IConfigurationRoot CreateConfigurationRoot()
{
return new ConfigurationBuilder()
.AddJsonFile("config.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
}
After creating the IConfigurationRoot
it can be passed to the services.AddFactroApiClientServices()
method to register all necessary services for the FactroApiClient
.
You can optionally setup logging too.
public static IServiceCollection ConfigureServices(IServiceCollection services)
{
// Do stuff here
var configurationRoot = CreateConfigurationRoot();
services.AddSingleton(configurationRoot);
services.AddFactroApiClientServices(configurationRoot);
return services;
}
After creating the ServiceProvider
the services can be used by getting it from the ServiceProvider
var appointmentApi = serviceProvider.GetRequiredService<IAppointmentApi>();