PHPackages                             howard1982/softlayer-api-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. howard1982/softlayer-api-php-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

howard1982/softlayer-api-php-client
===================================

add softlayer/softlayer-api-php-client to composer

037PHP

Since Jun 11Pushed 11y agoCompare

[ Source](https://github.com/howard1982/softlayer-api-php-client)[ Packagist](https://packagist.org/packages/howard1982/softlayer-api-php-client)[ RSS](/packages/howard1982-softlayer-api-php-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

A SoftLayer API PHP client.
===========================

[](#a-softlayer-api-php-client)

Overview
--------

[](#overview)

The SoftLayer API PHP client classes provide a simple method for connecting to and making calls from the SoftLayer API and provides support for many of the SoftLayer API’s features. Method calls and client management are handled by the PHP SOAP and XML-RPC extensions.

Making API calls using the SoftLayer\_SoapClient or SoftLayer\_XmlrpcClient classes is done in the following steps:

1. Instantiate a new SoftLayer\_SoapClient or SoftLayer\_XmlrpcClient object using the SoftLayer\_SoapClient::getClient() or SoftLayer\_XmlrpcClient::getClient() methods. Provide the name of the service that you wish to query, an optional id number of the object that you wish to instantiate, your SoftLayer API username, your SoftLayer API key, and an optional API endpoint base URL. The client classes default to connect over the public Internet. Enter SoftLayer\_SoapClient::API\_PRIVATE\_ENDPOINT or SoftLayer\_XmlrpcClient::API\_PRIVATE\_ENDPOINT to connect to the API over SoftLayer’s private network. The system making API calls must be connected to SoftLayer’s private network (eg. purchased from SoftLayer or connected via VPN) in order to use the private network API endpoints.
2. Define and add optional headers to the client, such as object masks and result limits.
3. Call the API method you wish to call as if it were local to your client object. This class throws exceptions if it’s unable to execute a query, so it’s best to place API method calls in try / catch statements for proper error handling.

Once your method is executed you may continue using the same client if you need to conenct to the same service or define another client object if you wish to work with multiple services at once.

The most up to date version of this library can be found on the SoftLayer github public repositories:  . Please post to the SoftLayer forums &lt;&gt; or open a support ticket in the SoftLayer customer portal if you have any questions regarding use of this library.

System Requirements
-------------------

[](#system-requirements)

The SoftLayer\_SoapClient class requires at least PHP 5.2.3 and the PHP SOAP enxtension installed. The SoftLayer\_Xmlrpc class requires PHP at least PHP 5 and the PHP XML-RPC extension installed.

A valid API username and key are required to call the SoftLayer API. A connection to the SoftLayer private network is required to connect to SoftLayer’s private network API endpopints.

Installation
------------

[](#installation)

Download and copy the SoftLayer API client to a directory local to your PHP project or a path within your PHP installation’s include\_path.

Usage
-----

[](#usage)

These examples use the SoftLayer\_SoapClient class. If you wish to use the XML-RPC API then replace mentions of SoapClient.class.php with XmlrpcClient.class.php and SoftLayer\_SoapClient with SoftLayer\_XmlrpcClient.

Here’s a simple usage example that retrieves account information by calling the [getObject](http://sldn.softlayer.com/reference/services/SoftLayer_Account/getObject) method in the [SoftLayer\_Account](http://sldn.softlayer.com/reference/services/SoftLayer_Account) service:

```
