Name | Last change | Commits | More actions | ||
---|---|---|---|---|---|
36e38f91make HOMAG API Gateway Client ready for Open Source Christian Decker | |||||
e99600c8Merged PR 50665: Implemented call to check optimization state of a job Andrei Manea | |||||
e99600c8Merged PR 50665: Implemented call to check optimization state of a job Andrei Manea | |||||
06532092Merged PR 50449: Implemented call to API Gateway for send to productionAssist Andrei Manea | |||||
36e38f91make HOMAG API Gateway Client ready for Open Source Christian Decker | |||||
3c9658b9Merged PR 44441: publish on Nuget.org Decker, Christian | |||||
e99600c8Merged PR 50665: Implemented call to check optimization state of a job Andrei Manea | |||||
36e38f91make HOMAG API Gateway Client ready for Open Source Christian Decker | |||||
36254c76Merged PR 43110: Add template import sample Manuel Schweikert | |||||
4a87fe02add TL;DR section Christian Decker | |||||
HOMAG API Gateway Client
The following repository contains the HOMAG API Gateway Client, the documentation and some samples for the usage.
With these packages you can easily integrate different workflows of HOMAG applications into your own application. For further details and prerequisites for using the API client, please see the documentation.
TL;DR
mkdir test-homag-api-gateway
dotnet new console
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
dotnet add package HomagGroup.DigitalFactory.ApiGateway.Client
using HomagGroup.DigitalFactory.ApiGateway.Client.Services;
using System.Text;
Console.WriteLine("Hello at the HOMAG API Gateway");
var client = new HttpClient();
client.BaseAddress = new Uri("https://api-gateway.homag.cloud");
Console.WriteLine("Please insert your token:");
var token = Console.ReadLine();
var credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes($"8878FEF1-E271-402D-B3C1-296FCBF7A854:{token}"));
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
var productionServices = new ProductionServices(client);
var workplaces = await productionServices.PMGetFeedbackWorkplaces();
Console.WriteLine($"We found {workplaces.Workplaces.Count} workplaces in your subscription.");
dotnet run
Getting started
- Clone the repository
git clone https://dev.azure.com/homag-group/FOSSProjects/_git/homag-api-gateway-client
cd homag-api-gateway-client
-
Get your personal access token from https://my.tapio.one
-
If you know your Subscription ID you can just insert this in the link below and continue with 3.
[https://my.tapio.one/subscriptions/ <Subscription ID>/applications/74fbbd3c-af43-4630-928b-e4022995fd02/addons/0e120a01-126a-4a19-a9b8-bbfc543345c1](https://my.tapio.one/subscriptions/ <Subscription ID>/applications/74fbbd3c-af43-4630-928b-e4022995fd02/addons/0e120a01-126a-4a19-a9b8-bbfc543345c1)
-
If you don't know your Subscription ID just go to https://my.tapio.one . Select your subscription, select Applications, open HOMAG productionManager and click on HOMAG File Agent.
-
Click on Edit and click on Add. Insert a name for your token, confirm and copy the token to your clipboard.
-
Copy Samples/appsettings.json to Samples/appsettings.test.json
cp Samples/csharp/HomagGroup.ApiGateway.Client.Samples/appsettings.json Samples/csharp/HomagGroup.ApiGateway.Client.Samples/appsettings.test.json
- Insert your access token in the Samples/appsettings.test.json. It should look like below.
{ "HomagApiGateway": { "BaseUrl": "https://api-gateway.homag.cloud", "Username": "8878FEF1-E271-402D-B3C1-296FCBF7A854", // Keep this username for your requests "Token": "" // Use your personal access token from tapio } }
-
-
Build the solution
dotnet build
- Run tests
dotnet test --filter TestCategory!=UserTestNoInteractionNeeded
Contribute
If you find anything, feel free to contribute to this repository. We are happy for every improvement ❤️.