![]() |
VOOZH | about |
dotnet add package Forbury.Integrations --version 1.9.3
NuGet\Install-Package Forbury.Integrations -Version 1.9.3
<PackageReference Include="Forbury.Integrations" Version="1.9.3" />
<PackageVersion Include="Forbury.Integrations" Version="1.9.3" />Directory.Packages.props
<PackageReference Include="Forbury.Integrations" />Project file
paket add Forbury.Integrations --version 1.9.3
#r "nuget: Forbury.Integrations, 1.9.3"
#:package Forbury.Integrations@1.9.3
#addin nuget:?package=Forbury.Integrations&version=1.9.3Install as a Cake Addin
#tool nuget:?package=Forbury.Integrations&version=1.9.3Install as a Cake Tool
👁 NuGet
👁 GitHub Workflow Status
👁 GitHub Workflow Status
This .NET client library provides a quick & easy option for integrating with Forbury APIs.
Note: In order to use this library, you must be an existing Forbury customer and have an API ClientId and ClientSecret.
To learn more about becoming a Forbury customer, or if you already are and would like access, please contact us.
Wiki page - Contains full documentation including examples.
Swagger API documentation - Contains the ability for sample requests and available endpoints.
In order to get started, please follow these steps.
1. Install the NuGet package using one of the following commands
Package Manager
Install-Package Forbury.Integrations -Version 1.7.0
.NET CLI
dotnet add PROJECT package Forbury.Integrations --version 1.7.0
PackageReference
<PackageReference Include="Forbury.Integrations" Version="1.7.0" />
For a full list of the latest releases, please see the package release page.
2. Add the following to your appsettings.config (replace UNIQUE_CLIENT_NAME, YOUR_CLIENT_ID and YOUR_CLIENT_SECRET).
This library supports a multi-client environment, UNIQUE_CLIENT_NAME can be any internal reference name you like for accessing the client.
If you only have one client, you will not need to choose which client to make calls with during runtime (please see example below).
"Forbury": {
"Api": {
"Url": "https://api.forbury.com/",
"Version": 1
},
"Authentication": {
"Url": "https://account.forbury.com/",
"Clients": {
"UNIQUE_CLIENT_NAME": {
"ClientId": "YOUR_CLIENT_ID",
"ClientSecret": "YOUR_CLIENT_SECRET"
},
"UNIQUE_CLIENT_NAME": {
"ClientId": "YOUR_CLIENT_ID",
"ClientSecret": "YOUR_CLIENT_SECRET"
}
}
}
}
3. Add the following inside your Startup.cs (.NET 3.1 and .NET 5).
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddForburyApi(Configuration);
...
}
Alternatively, you are able to create your own configuration object and pass that in as parameter instead.
This gives you the flexibility to build your configuration outside the standard appsettings.json structure.
public void ConfigureServices(IServiceCollection services)
{
var forburyConfiguration = new ForburyConfiguration()
{
Api = new ApiConfiguration()
{
Url = "https://api.forbury.com/",
Version = 1
},
Authentication = new AuthenticationConfiguration()
{
Url = "https://account.forbury.com/",
Clients = new Dictionary<string, AuthenticationClientConfiguration>()
{
{
"UNIQUE_CLIENT_NAME",
new AuthenticationClientConfiguration()
{
ClientId = "YOUR_CLIENT_ID",
ClientSecret = "YOUR_CLIENT_SECRET"
}
}
}
}
};
services.AddForburyApi(forburyConfiguration);
...
}
Note: If you are using the new .NET 6 design without a Startup.cs, add the following inside your Program.cs (.NET 6).
using Forbury.Integrations.API;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddForburyApi(builder.Configuration);
You should now be ready to use the API!
Example usage inside a Service.
Note: Please take note of the using statements, its important to import usings from the correct version (see versions below).
using Forbury.Integrations.API.v1.Dto;
using Forbury.Integrations.API.v1.Interfaces;
...
public class ForburyDataService
{
private readonly IForburyTeamApiClient _forburyTeamApiClient;
public ForburyDataService(IForburyTeamApiClient forburyTeamApiClient)
{
_forburyTeamApiClient = forburyTeamApiClient;
// NOTE: In a multi-client environment, you will need to set the client
_forburyTeamApiClient.SetClient("UNIQUE_CLIENT_NAME");
}
public async Task GetTeams(int amount = 20, int page = 1)
{
PagedResult<TeamDto> teams = await _forburyTeamApiClient.GetTeams(amount, page);
// Do work here
...
}
public async Task GetModelDataForTeam(int id, DateTime? fromDate = null, int amount = 20, int page = 1)
{
PagedResult<ModelDto> models = await _forburyTeamApiClient.GetModelsByTeamId(id, fromDate, null, amount, page);
// Do work here
...
}
}
Currently available API versions:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 netcoreapp3.1 is compatible. |
| .NET Framework | net48 net48 is compatible. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.