PHPackages                             flipoll/php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. flipoll/php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

flipoll/php-sdk
===============

fliPoll SDK for PHP

1.0.x-dev(9y ago)06MITPHPPHP ^5.4|^7.0

Since May 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/flipoll/php-sdk)[ Packagist](https://packagist.org/packages/flipoll/php-sdk)[ Docs](https://github.com/flipoll/php-sdk)[ RSS](/packages/flipoll-php-sdk/feed)WikiDiscussions 1.0 Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

fliPoll SDK for PHP
===================

[](#flipoll-sdk-for-php)

[![MIT License](https://camo.githubusercontent.com/0a4d532521f1fa6d8feaecdc11e09f87b4b6d172c14b1ef9cdf05b9e1a125bf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666c69706f6c6c2f7068702d73646b2e7376673f7374796c653d666c6174)](https://github.com/flipoll/php-sdk/blob/master/LICENSE)

This repository contains PHP code that allows for the easy integration of fliPoll into server-side applications.

Resources
---------

[](#resources)

- [REST API Overview](https://flipoll.com/developer/api) - The purpose and basic functionality of the REST API
- [API Getting Started Guide](https://flipoll.com/developer/api/start) - How to start using the REST API
- [REST API Reference](https://flipoll.com/developer/api/reference) - List of all REST API resources
- [PHP SDK Overview](https://flipoll.com/developer/api/sdks/php) - The design and basics of the PHP SDK
- [PHP SDK Getting Started Guide](https://flipoll.com/developer/api/sdks/php/start) - How to start using the PHP SDK
- [PHP SDK Reference](https://flipoll.com/developer/api/sdks/php/reference) - List of main PHP SDK classes
- [API SDKs](https://flipoll.com/developer/api/sdks) - All available REST API SDKs

Getting Started
---------------

[](#getting-started)

1. **Signup with fliPoll** - Before you can use the SDK, you need a fliPoll account with app credentials. To create an account, go to [fliPoll](https://flipoll.com) and click the **Sign Up** button in the top right hand corner of the screen.
2. **Create a fliPoll app** - Once you have a fliPoll account, login and navigate to your [App Dashboard](https://flipoll.com/settings/apps) to create an app then save off its `app id` and `app secret` to be used later on.
3. **Minimum requirements** - The PHP SDK requires a system including **PHP &gt;= 5.4** compiled with **cURL &gt;= 7.20.0**.
4. **Install the SDK** - The PHP SDK can be included either through an installation via Composer or by downloading the SDK zip file from GitHub and including it directly.

    - Installing via Composer

        1. Install Composer via the command line.

            ```
            $ curl -sS https://getcomposer.org/installer | php
            ```
        2. Run the Composer command to install the latest stable version of the SDK via the command line.

            ```
            $ php composer.phar require flipoll/php-sdk
            ```
        3. Require Composer's autoloader at the top of the PHP file(s) that will use the SDK.

            ```
            require 'vender/autoload.php';
            ```
    - Installing via Zip

        1. Download the zip file from [GitHub](https://github.com/flipoll/php-sdk).
        2. Copy the src directory into the codebase that will use the SDK.
        3. Require the fliPoll autoloader at the top of the PHP file(s) that will use the SDK.

            ```
            require '/path/to/fliPoll/autoload.php';
            ```
5. **Using the SDK** - To learn how to use the PHP SDK, the [PHP SDK Getting Started Guide](https://flipoll.com/developer/api/sdks/php/start) is the best resource for information on the design and incorporation of the SDK into an application. For details on the main classes contained within the SDK, see the [PHP SDK Reference](https://flipoll.com/developer/api/sdks/php/reference).

Examples
--------

[](#examples)

### Initialization

[](#initialization)

The following code initializes the PHP SDK with the minimum required options.

```
require 'vender/autoload.php';

$fliPoll = \fliPoll\fliPoll([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}'
]);
```

### App Access Token Retrieval

[](#app-access-token-retrieval)

The following code initializes the PHP SDK then retrieves an app access token from the fliPoll servers.

```
require 'vender/autoload.php';

$fliPoll = \fliPoll\fliPoll([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}'
]);

try {
  // Get an OAuth 2.0 client
  $oauth2Client = $fliPoll->getOAuth2Client();

  // Retrieve an app access token from the fliPoll servers
  $accessToken = $oauth2Client->getAppAccessToken();

  // Set an access token with the base class dynamically
  $fliPoll->setAccessToken($accessToken);
} catch (\fliPoll\Exceptions\fliPollSdkException $e) {
  exit('SDK error occurred: ' . $e->getMessage());
} catch (\fliPoll\Exceptions\fliPollAuthenticationException $e) {
  exit('Authentication error occurred: ' . $e->getMessage());
} catch (\Exception $e) {
  exit('Error occurred: ' . $e->getMessage());
}
```

### API Request

[](#api-request)

The following code initializes the PHP SDK with an existing access token then executes an API request and outputs the results.

```
require 'vender/autoload.php';

$fliPoll = \fliPoll\fliPoll([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}',
  'access_token' => '{access-token}' // Set an access token at initialization
]);

try {
  // Execute an API request and retrieve the response
  $response = $fliPoll->api('/461');

  // Output the results of the API request
  var_dump($response->getResults());
} catch (\fliPoll\Exceptions\fliPollSdkException $e) {
  exit('SDK error occurred: ' . $e->getMessage());
} catch (\fliPoll\Exceptions\fliPollApiException $e) {
  exit('API error occurred: ' . $e->getMessage());
} catch (\Exception $e) {
  exit('Error occurred: ' . $e->getMessage());
}
```

Contributing
------------

[](#contributing)

We're big proponents of community collaboration so we encourage our users to submit issues for potential bugs as well as proposed features and enhancements.

To help us better handle issue requests, search the existing issues list first to verify your problem hasn't already been reported. Also, providing the PHP version, OS name and version, and SDK version used when an issue was encountered is recommended.

License
-------

[](#license)

Please see the [license file](https://github.com/flipoll/php-sdk/blob/master/LICENSE) for more information.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3322d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bbd835435a3d669d74d332ba7eecefd38924ef9aad917a25521784bd19a2e0c?d=identicon)[fliPoll](/maintainers/fliPoll)

---

Top Contributors

[![nathanbeigel](https://avatars.githubusercontent.com/u/14081688?v=4)](https://github.com/nathanbeigel "nathanbeigel (43 commits)")

---

Tags

phpsdkflipoll

### Embed Badge

![Health badge](/badges/flipoll-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/flipoll-php-sdk/health.svg)](https://phpackages.com/packages/flipoll-php-sdk)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
