KO
|
EN
gitlite — search
Search
#python
#claude
#ai
#mcp
#cli
#claude-code
#ai-agents
#react
#llm
#macos
#nodejs
#typescript
lob-php
★ 66
Open GitHub ↗
PHP Client for Lob API
Download README (.md)
Explore Similar Repositories
jquery-lockfixed
:
jQuery lockfixed plugin
puremvc-lua
:
No description available.
heroku-buildpack-hhvm
:
Use HHVM on Heroku
meeting-minutes
:
Official minutes for Rust-related meetings
paper-date-picker
:
A date picker à la Material Design
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
lob-php
?
Download (.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. For more information, please visit [our API documentation](https://docs.lob.com/). Looking for our [legacy PHP SDK](https://github.com/lob/lob-php/tree/v3-legacy)? ## Requirements PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested. ## Getting Started ### Registration First, you will need to first create an account at [Lob.com](https://dashboard.lob.com/#/register) and obtain your Test and Live API Keys. Once you have created an account, you can access your API Keys from the [Settings Panel](https://dashboard.lob.com/#/settings). ### Installation & Usage #### Composer To install the bindings via [Composer](https://getcomposer.org/), run `php composer.phar install` ### Manual Installation Download the files and include `autoload.php`: ```php <?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php'); ``` ## First API Call ```php <?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](https://docs.lob.com/). ## Authorization ### basicAuth - **Type**: HTTP basic authentication ## Testing Before running tests, ```bash $ composer install ``` ### Unit Tests ```bash $ 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. To run integration tests: ```bash $ 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: ```bash $ echo "LOB_API_TEST_KEY=<<YOUR TEST KEY>> LOB_API_LIVE_KEY=<<YOUR LIVE KEY>>" > LOCAL.env ``` Then, to run the integration tests: ```bash $ env $(cat LOCAL.env) vendor/bin/phpunit --group integration --coverage-text --coverage-html coverage/html ``` ## Author lob-openapi@lob.com ## About this package This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `1.3.0` - Package version: `1.0.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen`