lob.dotnet 1.0.0

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="lob.dotnet" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add lob.dotnet --version 1.0.0
#r "nuget: lob.dotnet, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

.NET

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 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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 547 2/19/2024
1.1.2 219 1/18/2024
1.1.1 994 11/8/2023
1.1.0 15,958 1/17/2023
1.0.0 517 9/15/2022
0.0.1 389 9/9/2022

Beta Release