### Get a Single Resource from Fortnox API (C#) Source: https://github.com/zenta-ab/fortnox.net/blob/master/README.md Illustrates how to fetch a single resource from the Fortnox API using the Fortnox.NET SDK. This method requires creating a FortnoxApiRequest object with authentication credentials and passing it along with the resource identifier to the relevant service method. ```csharp var request = new FortnoxApiRequest("ACCESS-TOKEN", "CLIENT-SECRET"); var response = await ArticleService.GetArticleAsync(request, "100370"); ``` -------------------------------- ### Get a List of Resources in Fortnox API (C#) Source: https://github.com/zenta-ab/fortnox.net/blob/master/README.md Demonstrates how to retrieve a list of resources from the Fortnox API using the Fortnox.NET SDK. It involves creating a ListRequest object with authentication details and calling the appropriate service method. Filters and ordering can be applied if the API endpoint supports them. ```csharp var request = new OrderListRequest("ACCESS-TOKEN", "CLIENT-SECRET"); var orders = await OrderService.GetOrdersAsync(request); ``` ```csharp var request = new EmployeeListRequest("ACCESS-TOKEN", "CLIENT-SECRET") { Filter = EmployeeFilters.Active }; var employeeList = await EmployeeService.GetEmployeesAsync(request); ``` -------------------------------- ### Connect and Subscribe to Fortnox WebSocket API (C#) Source: https://github.com/zenta-ab/fortnox.net/blob/master/README.md Shows how to establish a connection to the Fortnox WebSocket API for real-time updates. This involves creating a FortnoxWebSocketClient, connecting, adding topics and tenants, subscribing, and then processing incoming messages. ```csharp var client = new FortnoxWebSocketClient(this.connectionSettings.ClientSecret); await client.Connect(); await client.AddTenant(this.connectionSettings.AccessToken); await client.AddTopic(WebSocketTopic.Articles); await client.Subscribe(); ``` ```csharp var client = new FortnoxWebSocketClient(this.connectionSettings.ClientSecret); await client.Connect(); await client.AddTenant(this.connectionSettings.AccessToken); var addTenantResponse = await client.Receive(); await client.AddTopic(WebSocketTopic.Articles); var addTopicResponse = await client.Receive(); await client.Subscribe(); var subscribeResponse = await client.Receive(); while (ListenToIncomingEvents) { var response = await client.Receive(); if (response.Type == WebSocketResponseType.EventResponse) { // Handle events } if (response.Type == WebSocketResponseType.CommandResponse) { // Handle commands } } await client.Close(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.