API clients for consuming LinkShare developer APIs.
This package provides clients for LinkShare's developer APIs.
Implementation is based on The PHP League's OAuth 2.0 client libraries.
Currently implemented APIs:
- Link Locator (partial implementation)
- Product Search
You can find examples of how to use the APIs under the examples folder.
Generally though, a new API client is created in the following fashion:
// Options contain the information required for
// authenticating against the API endpoints.
$options = [
// Required: The client ID as provided by the developer's portal
// This will vary for each API.
'client_id' => $clientId,
// Required: The client secret as provided by the developer's portal
// This will vary for each API.
'client_secret' => $password,
// Required: The access token as provided by the developer's portal
// This will vary for each API.
'access_token' => $access_token,
// Required: Your LinkShare Affiliate username
'username' => $username,
// Required: Your LinkShare Affiliate password
'password' => $password,
// Required: Your LinkShare Affiliate Site ID
'scope' => $scope,
// Optional: The timeout (in seconds) before a request fails
'timeout' => $timeout,
];
// To create an API client, simply supply the required options as shown above
$linkLocator = new LinkLocator($options);
$productSearch = new ProductSearch($options);