2017 © Pedro Peláez
 

library lob-php

Lob.com API PHP wrapper.

image

lob/lob-php

Lob.com API PHP wrapper.

  • Tuesday, July 3, 2018
  • by lob
  • Repository
  • 34 Watchers
  • 52 Stars
  • 211,052 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 12 Forks
  • 1 Open issues
  • 41 Versions
  • 11 % Grown

The README.md

OpenAPIClient-php

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., (*1)

For more information, please visit our API documentation. Looking for our legacy PHP SDK?, (*2)

Requirements

PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested., (*3)

Getting Started

Registration

First, you will need to first create an account at Lob.com and obtain your Test and Live API Keys., (*4)

Once you have created an account, you can access your API Keys from the Settings Panel., (*5)

Installation & Usage

Composer

To install the bindings via Composer, run php composer.phar install, (*6)

Manual Installation

Download the files and include autoload.php:, (*7)

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

First API Call

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: basicAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenAPI\Client\Api\AddressesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$address_editable = new \OpenAPI\Client\Model\AddressEditable(); // \OpenAPI\Client\Model\AddressEditable

try {
    $result = $apiInstance->addressCreate($address_editable);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AddressesApi->addressCreate: ', $e->getMessage(), PHP_EOL;
}

API Documentation

The full and comprehensive documentation of Lob's APIs is available here., (*8)

Authorization

basicAuth

  • Type: HTTP basic authentication

Testing

Before running tests,, (*9)

$ composer install

Unit Tests

$ vendor/bin/phpunit --group unit --coverage-text --coverage-html coverage/html

Integration Tests

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., (*10)

To run integration tests:, (*11)

$ LOB_API_TEST_KEY=<<YOUR TEST KEY>> LOB_API_LIVE_KEY=<<YOUR LIVE KEY>> vendor/bin/phpunit --group integration --coverage-text --coverage-html coverage/html

A cleaner alternative if you are going to run integration tests frequently

Run this the first time:, (*12)

$ echo "LOB_API_TEST_KEY=<<YOUR TEST KEY>> LOB_API_LIVE_KEY=<<YOUR LIVE KEY>>" > LOCAL.env

Then, to run the integration tests:, (*13)

$ env $(cat LOCAL.env) vendor/bin/phpunit --group integration --coverage-text --coverage-html coverage/html

Author

lob-openapi@lob.com, (*14)

About this package

This PHP package is automatically generated by the OpenAPI Generator project:, (*15)

  • API version: 1.3.0
    • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

The Versions

03/07 2018

v3.0.0

3.0.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

02/07 2018

dev-master

9999999-dev https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/05 2018

v2.3.0

2.3.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

13/03 2018

v2.2.0

2.2.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

31/01 2018

v2.1.3

2.1.3.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

11/01 2018

v2.1.2

2.1.2.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

17/11 2017

dev-test-cleanup

dev-test-cleanup https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

10/08 2017

v2.1.1

2.1.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

09/08 2017

dev-idempotent

dev-idempotent https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

04/08 2017

v2.1.0

2.1.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

17/05 2017

v2.0.0

2.0.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

07/10 2016

v1.7.1

1.7.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

06/10 2016

v1.7.0

1.7.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

20/09 2016

v1.6.4

1.6.4.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

01/08 2016

v1.6.3

1.6.3.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

11/07 2016

dev-upgrade-guzzle

dev-upgrade-guzzle https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

27/06 2016

v1.6.2

1.6.2.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

14/05 2016

v1.6.1

1.6.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

01/02 2016

v1.6.0

1.6.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

08/12 2015

v1.5.0

1.5.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

11/05 2015

v1.4.2

1.4.2.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

29/04 2015

v1.4.1

1.4.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

25/04 2015

v1.4.0

1.4.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/04 2015

v1.3.0

1.3.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

23/01 2015

v1.2.8

1.2.8.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

10/01 2015

v1.2.7

1.2.7.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

10/12 2014

v1.2.6

1.2.6.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

03/11 2014

v1.2.5

1.2.5.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

02/10 2014

v1.2.4

1.2.4.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

20/09 2014

v1.2.3

1.2.3.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

11/09 2014

v1.2.2

1.2.2.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

04/09 2014

v1.2.0

1.2.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

04/09 2014

v1.2.1

1.2.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/08 2014

v1.1.5

1.1.5.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/08 2014

v1.1.4

1.1.4.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

29/05 2014

v1.1.3

1.1.3.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/05 2014

V1.1.2

1.1.2.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/05 2014

V1.1.1

1.1.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

21/05 2014

V1.1.0

1.1.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

19/01 2014

v1.0.1

1.0.1.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob

23/07 2013

v1.0.0

1.0.0.0 https://www.lob.com/

Lob.com API PHP wrapper.

  Sources   Download

MIT

The Requires

 

The Development Requires

api rest wrapper web service printing lob