Download the PHP package boldgrid/reseller-api without Composer
On this page you can find all versions of the php package boldgrid/reseller-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download boldgrid/reseller-api
More information about boldgrid/reseller-api
Files in boldgrid/reseller-api
Package reseller-api
Short Description PHP Client for BoldGrid Reseller API
License GPL2.0
Informations about the package reseller-api
BoldGrid API PHP SDK
Using composer, you can get started quickly:
In your code, use the normal procedures of requiring the autoloader. This client uses PSR-4 specification for autoloading:
Now you can start using the API. The examples below will assume that your using the namespaces:
Then you can kick off by creating a new api call using the default settings:
The endpoint is pointing to production, but you can easily switch this to the Reseller API sandbox endpoints by passing in the sandbox instance to the new Boldgrid constructor like this:
Alternatively, you can this syntax to accomplish the same goal:
The calls will utilize token based authentication and look for stored responses in the session data. You can choose to store the data in memcache instead by passing an instance of a class utilizing the Storage interface. This example shows how to set the storage to use Memcache instead of Session:
Alternatively you can use the following syntax to accomplish the same thing:
Using the token based authentication, which is the default auth method - you will need to set the auth params. The tokens have a set expiration of 2 days for the BoldGrid Reseller API, so you will need to provide a way to retrieve the key/secret securely in your application. This can be done by passing in the key and reseller key, like this:
We recommend sticking with the token based authentication for making calls from distributed applications, but you may wish to use other authentication methods when making calls. If you decide to use one of the other authentication methods you can simply pass the auth type desired to the setAuth method. The supported types are token, basic, and key. You can read more about the API authentication methods in our API documentation.
This example shows how to switch to using Basic Authentication for your call, which will require you to pass in your key and reseller key secret:
This example shows how to authorize with only the key and reseller key:
Now that you know how to set the environment, authorization, and storage types - you can start making calls utilizing the BoldGrid Reseller API Client. Each call is segmented to it's base and endpoint. For instance, if you're looking to make a call to the key/list endpoint, the syntax would be like:
Here's an example that sets the environment to the sandbox API, uses token authorization (default ), stores the token in memcache, and generates the key list of the clients under the reseller:
Here's a list of available calls that can be made: