usabilla / usabilla-api-php
0.5.0
2017-12-22 11:06 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle-services: 0.5.*
Requires (Dev)
- codeclimate/php-test-reporter: 0.3.*
- phpunit/phpunit: 5.*
This package is not auto-updated.
Last update: 2025-05-10 22:54:56 UTC
README
This package allows PHP developers to gain access to the Usabilla resources such as buttons, feedback items, campaigns and their results. This packages is heavily inspired by the AWS PHP Client.
Resources
- API Documentation – For in-depth getting started and usage information.
Features
- Built for PHP 5.6+ and compliant with PSR-4.
- Built on Guzzle Services.
- Installable through Composer.
Getting Started
- Install Composer by following installation instructions on: https://getcomposer.org/download/
- Request Usabilla API credentials.
- Run
composer require usabilla/usabilla-api-php
on your project.
Quick Example
Request 5 feedback items belonging to a button.
<?php require 'vendor/autoload.php'; use Usabilla\API\Client\UsabillaClient; // Creates a new Usabilla client. $client = new UsabillaClient('ACCESS_KEY', 'SECRET_KEY'); // Specify the parameters as mentioned in the service description. $params = ['id' => 'BUTTON_ID', 'limit' => 5]; // Gets the command. $command = $client->getCommand('GetWebsiteFeedbackItems', $params); // Executes the command. $response = $client->execute($command); // Prints the received response. print_r($response);
Using Command Line
You can use the command line to retrieve results from the API using scripts found in the example folder:
-
Using single_page.php :
php single_page.php {command} {access-key} {secret-key}
-
Using single_page_with_id.php :
php single_page_with_id.php {command} {id} {access-key} {secret-key}