shippingapi 1.2.0
See the version list below for details.
dotnet add package shippingapi --version 1.2.0
NuGet\Install-Package shippingapi -Version 1.2.0
<PackageReference Include="shippingapi" Version="1.2.0" />
paket add shippingapi --version 1.2.0
#r "nuget: shippingapi, 1.2.0"
// Install shippingapi as a Cake Addin
#addin nuget:?package=shippingapi&version=1.2.0
// Install shippingapi as a Cake Tool
#tool nuget:?package=shippingapi&version=1.2.0
Pitney Bowes Shipping API C# Client
This project has the code for a NuGet package that provides a fluent C# interface to the Pitney Bowes Shipping API. The package uses the .NET Standard 2.0 framework, meaning it is compatible with:
- .NET core 2.0
- .NET framework 4.6.1 and above
Mono and Xamarin are also supported.
Features:
- full wrapping of the API. Hides (encapsulates) all protocol details, including authentication and report pagination..
- strong typing – objects for all entities. Enums for all options – which really helps in visual studio intellisense.
- Contract via interfaces as well as DTOs to reduce the need to copy data
- Linq provider for reports
- Fluent interface - less typing and really good way to extend with extension methods
- Support for the metadata provided by the carrier rules method. Use this for local validation/UI options/rate shop.
- Mocking and recording of live messages to disk for capture or later playback in mock mode. Mocking for unit and regression testing.
- Example console app.
- Plug in your own configuration and log providers
- Keeps the API secret out of cleartext
Latest changes - CHANGES
Prerequisites
To use the C# client to generate shipping labels, you will need a Pitney Bowes Shipping API sandbox account. The account is free and gives access to a fully functional sandbox environment. Sign up for the account here: Shipping API Signup.
You will need the following information from your Shipping API account. To get the information, see Getting Started.
- Your API key
- API secret
- Developer ID
- Shipper ID
VSCode or Visual Studio. The Community Edition of Visual Studio is fine.
dotnet core 2.0 or later
git command line (required if building the system out-of-box)
Getting Started
You can get started by doing either of the following:
Using the NuGet Package
If you just want to use the solution without building it, download it from on nuget.org.
If you are developing on Windows, I'd recommend that you install Telerik Fiddler, which will let you see the messages with the Pitney Bowes servers.
Support
If you encounter problems, please contact Support at ShippingAPISupport@pb.com.
Building the System Out-of-Box
The following commands are specific to Windows. The code also builds on macOS Sierra using Visual Studio Community edition and VSCode.
At the Visual Studio developer command prompt:
C:\Development>mkdir apitest
C:\Development>cd apitest
C:\Development\apitest>git clone https://github.com/PitneyBowes/pitneybowes-shipping-api-csharp.git
Cloning into 'pitneybowes-shipping-api-csharp'...
remote: Counting objects: 665, done.
remote: Total 665 (delta 0), reused 0 (delta 0), pack-reused 665
Receiving objects: 100% (665/665), 1.49 MiB | 352.00 KiB/s, done.
Resolving deltas: 100% (505/505), done.
C:\Development\apitest\shippingAPI> cd pitneybowes-shipping-api-csharp
C:\Development\apitest\shippingAPI> dotnet restore
C:\Development\apitest\shippingAPI> dotnet build
C:\Development\apitest\shippingAPI> dotnet publish
C:\Development\apitest\shippingAPI> cd examples\example.core\bin\Debug\netcoreapp2.0\publish
C:\Development\apitest\examples\example.core\bin\Debug\netcoreapp2.0\publish> dotnet example.dll
9405509898642004103722
Document written to C:\Users\patrick\AppData\Local\Temp\2\USPS2200080642743578.PDF
Document written to C:\Users\patrick\AppData\Local\Temp\2\9475709899581000234042.PDF
Running the tests
The tests use xunit. The API can run in either live or mocked mode. When it is in mocked mode the response to API requests are read from a file. The file is identified by certain attributes of the response - transaction ID in the case of a shipment, so different test scenarios can be set up using the mocked interface.
Tests can also be run from sample messages - the message is deserialized from a file and an API request is created and sent. See the files in the testData folder for examples.
Built With
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- *Amit Kumar Singh - [Pitney Bowes]
See also the list of contributors who participated in this project.
License
Copyright 2016 Pitney Bowes Inc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License in the README file or at https://opensource.org/licenses/MIT Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- see the LICENSE.md file for details
Acknowledgments
- NewtonSoft.JSON
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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 10.0.3)
- System.Linq.Queryable (>= 4.3.0)
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.6.0 | 634 | 4/26/2021 |
1.5.1 | 835 | 9/29/2020 |
1.5.0 | 474 | 9/25/2020 |
1.4.0 | 709 | 9/24/2020 |
1.3.3 | 546 | 8/21/2020 |
1.3.2 | 487 | 8/16/2020 |
1.3.1 | 465 | 8/12/2020 |
1.3.0 | 769 | 6/26/2020 |
1.2.2 | 506 | 6/19/2020 |
1.2.1 | 615 | 5/29/2020 |
1.2.0 | 529 | 4/27/2020 |
1.1.5 | 778 | 2/13/2020 |
1.1.4 | 714 | 11/11/2019 |
1.1.3 | 515 | 11/5/2019 |
1.1.2 | 497 | 11/4/2019 |
1.1.1 | 513 | 11/4/2019 |
1.1.0 | 921 | 3/5/2019 |
1.1.0-prerelease | 658 | 2/4/2019 |
1.0.12 | 1,167 | 7/3/2018 |
1.0.11 | 1,033 | 3/8/2018 |
1.0.10 | 929 | 3/6/2018 |
1.0.9 | 991 | 3/6/2018 |
1.0.8 | 985 | 3/6/2018 |
1.0.7 | 1,232 | 1/3/2018 |
1.0.6-beta | 965 | 12/28/2017 |
1.0.5-beta | 842 | 12/28/2017 |