WhatPulse PHP SDK
The official PHP SDK makes it easy to connect your PHP applications to the WhatPulse API. It handles authentication, requests, and responses for you.
Installation
You’ll need PHP 8.1 or later. Install the SDK using Composer:
composer require whatpulse/api-sdk-php
Authentication
To use the API, you’ll need an API key. Create one here.
Configure the SDK with your API key:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = WhatPulse\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
Usage Example
Here’s how to fetch a user’s computers:
$apiInstance = new WhatPulse\Api\ComputersApi(
new GuzzleHttp\Client(),
$config
);
$id = 'your_user_id_or_username';
try {
$result = $apiInstance->v1UsersComputers($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), PHP_EOL;
}
API Coverage
The SDK supports all public WhatPulse API endpoints, including users, teams, computers, and more. This SDK is automatically generated from the OpenAPI specification, making sure it stays up-to-date with the latest API changes.
This also means that you can find all the available functions and classes on GitHub: https://github.com/whatpulse/api-sdk-php/
More Information
Need help? Join our Discord or email support@whatpulse.org.