lob.dotnet
1.0.0
See the version list below for details.
dotnet add package lob.dotnet --version 1.0.0
NuGet\Install-Package lob.dotnet -Version 1.0.0
<PackageReference Include="lob.dotnet" Version="1.0.0" />
paket add lob.dotnet --version 1.0.0
#r "nuget: lob.dotnet, 1.0.0"
// Install lob.dotnet as a Cake Addin #addin nuget:?package=lob.dotnet&version=1.0.0 // Install lob.dotnet as a Cake Tool #tool nuget:?package=lob.dotnet&version=1.0.0
lob-dotnet
The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.3.0
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
For more information, please visit https://support.lob.com/
Requirements
Getting Started
Registration
First, you will need to first create an account at Lob.com and obtain your Test and Live API Keys.
Once you have created an account, you can access your API Keys from the Settings Panel.
Installation
$ dotnet add package lob.dotnet
First API Call
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
using System.Collections.Generic;
using System.Diagnostics;
using lob.dotnet.Api;
using lob.dotnet.Client;
using lob.dotnet.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.lob.com/v1";
// Configure HTTP basic authorization: basicAuth
config.Username = "<<YOUR_LOB_API_KEY>>";
var apiInstance = new AddressesApi(config);
var addressEditable = new AddressEditable();
try
{
// create
Address result = apiInstance.create(addressEditable);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressesApi.create: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
API Documentation
The full and comprehensive documentation of Lob's APIs is available here.
Testing
Unit Testing
$ dotnet test --filter Category=Unit
Integration Testing
Integration tests run against a live deployment of the Lob API and require multiple valid API keys with access to specific features. As such, it is not expected that these tests will pass for every user in every environment.
To run integration tests:
$ LOB_API_TEST_KEY=<<YOUR TEST KEY>> LOB_API_LIVE_KEY=<<YOUR LIVE KEY>> dotnet test --filter Category=Integration
A cleaner alternative if you are going to run integration tests frequently
Run this the first time:
$ echo "LOB_API_TEST_KEY=<<YOUR TEST KEY>> LOB_API_LIVE_KEY=<<YOUR LIVE KEY>>" > LOCAL.env
Then, to run the integration tests:
$ env $(cat LOCAL.env) dotnet test --filter Category=Integration
Documentation for Authorization
basicAuth
- Type: HTTP basic authentication
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- JsonSubTypes (>= 1.8.0)
- Newtonsoft.Json (>= 13.0.1)
- Polly (>= 7.2.3)
- RestSharp (>= 106.13.0)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Beta Release