Download the PHP package upmind/sdk without Composer
On this page you can find all versions of the php package upmind/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sdk
Upmind - SDK
This SDK can be used to streamline PHP integrations with the Upmind API.
- Requirements
- Installation
- Usage
- Getting Started
- Exceptions
- Pagination
- Relations
- Creating Resources
- Manual Usage
- Changelog
- Contributing
- Credits
- License
- Upmind
Requirements
- PHP 7.4, 8.0, 8.1, 8.2 or 8.3
- Composer
- HTTPlug-compatible Client e.g., Guzzle
- Upmind Starter plan or higher
Installation
This library makes use of the HTTPLUG abstraction for making HTTP requests, using discovery to automatically detect an HTTP client to use. Because the library depends on the virtual package psr/http-client-implementation
you will need to first install a compatible HTTP client implementation e.g., php-http/guzzle7-adapter.
It's possible to use any implementations of the following PSRs:
Usage
Getting Started
To use the SDK you will need to first create an API token in your Upmind admin area settings. You should also make note of your brand ID.
First you will need to create a Config
instance with your API token and brand ID. Then, use that to create an instance of the Api
client. Set the debug
option to true
to stream API requests and responses to STDERR; alternatively you can pass an alternative PSR-3 compliant logger when instantiating the API.
You can then get an instance of a service to start making API requests.
Exceptions
All exceptions thrown by this library implement the marker interface Upmind\Sdk\Exceptions\UpmindSdkException
.
By default, API error (non-2xx) responses will throw an instance of Upmind\Sdk\Exceptions\HttpException
which contains the API error response data. You can turn off HttpExceptions by instantiating Config
with restfulExceptions: false
,
HTTP Exceptions Enabled
With HTTP exceptions enabled (default), there is no need to inspect the HTTP code or response body to detect errors, as the SDK will throw an exception for any non-2xx HTTP response.
HTTP Exceptions Disabled
With HTTP exceptions disabled, you can inspect the ApiResponse to determine whether it succeeded or not.
Pagination
Most list requests will return paginated results. The SDK will allow you to pass a QueryParams
object to control pagination by setting limit
(default 10) and offset
(default 0) query parameters.
Relations
Some resources have relationships with other resources. You can specify relationships to load by setting the with
query parameter when making GET requests. This reduces the number of API requests needed to fetch related resources.
Creating Resources
Create methods are typed with DTOs containing setter methods to help you identify which parameters are available. When a resource is created successfully, an id
will be returned which can be used to fetch and manage the resource later.
Manual Usage
Some resources may not have a corresponding service in the SDK. You can use the Api
client to make requests manually to any endpoint. Here's an example showing how to import an existing order (contract product) into Upmind.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Harry Lewis
- Sam Burns
- All Contributors
License
GNU General Public License version 3 (GPLv3). Please see License File for more information.
Upmind
Sell, manage and support web hosting, domain names, ssl certificates, website builders and more with Upmind.com.
All versions of sdk with dependencies
ext-json Version *
nyholm/psr7 Version ^1.8
php-http/client-common Version ^2.7
php-http/discovery Version ^1.19
php-http/logger-plugin Version ^1.3
psr/http-client-implementation Version *
psr/log Version *