PHPackages                             qualiaanalytics/php-api - 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. qualiaanalytics/php-api

ActiveLibrary

qualiaanalytics/php-api
=======================

PHP wrapper to interact with Qualia Analytics API Edit

1.0.3(8y ago)19MITPHPPHP ^5.3|^7.0

Since Jul 26Pushed 8y ago3 watchersCompare

[ Source](https://github.com/QualiaAnalytics/PHP-API)[ Packagist](https://packagist.org/packages/qualiaanalytics/php-api)[ RSS](/packages/qualiaanalytics-php-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

[![](https://camo.githubusercontent.com/6d85285a954518e263432b9bb013f54dd3411acd4d7f7a28492e24c799644a1a/68747470733a2f2f73332d65752d776573742d312e616d617a6f6e6177732e636f6d2f71612d7375727665792d73797374656d2f696d6167652d75706c6f61642f505754363252503778735566517048392e706e67)](https://camo.githubusercontent.com/6d85285a954518e263432b9bb013f54dd3411acd4d7f7a28492e24c799644a1a/68747470733a2f2f73332d65752d776573742d312e616d617a6f6e6177732e636f6d2f71612d7375727665792d73797374656d2f696d6167652d75706c6f61642f505754363252503778735566517048392e706e67)

### Qualia Analytics

[](#qualia-analytics)

[![Build Status](https://camo.githubusercontent.com/642464d0e234587c687e22a83d4b972611e4de0d91cfe3b7982d47a1903a65f4/68747470733a2f2f7472617669732d63692e6f72672f5175616c6961416e616c79746963732f5048502d4150492e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/QualiaAnalytics/PHP-API)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ec7f8ad2d33336850a15a9ce0fa3ae5f7a89aaf1afdc33463a25febe8aa982c0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5175616c6961416e616c79746963732f5048502d4150492f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/QualiaAnalytics/PHP-API/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/9bc1fd5e0d059b2c91f7157b17dc708fd62f17988172238c3c06a5302ce8ef33/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5175616c6961416e616c79746963732f5048502d4150492f6d61737465722e737667)](https://scrutinizer-ci.com/g/QualiaAnalytics/PHP-API/)

PHP wrapper to interact with Qualia Analytics API

### Prerequisites

[](#prerequisites)

- PHP 5.3+
- Composer

### Installing

[](#installing)

#### Composer

[](#composer)

```
composer require qualiaanalytics/php-api

```

```
// Import library from composer
require __DIR__ . '/vendor/autoload.php';
```

### Usage

[](#usage)

#### Create Client

[](#create-client)

```
$client = new \Qualia\Client("YOUR_SURVEY_ID", "API_KEY");
```

Please provide SURVEY\_ID and API\_KEY parameters to client constructor.

#### Build a request and submit

[](#build-a-request-and-submit)

```
$response = \Qualia\Submission\Entry::build($client)
                                  ->name("QUESTION_ID", "First Name", "Last Name")
                                  ->email("QUESTION_ID", "email@example.com")
                                  ->date("QUESTION_ID", "2020-01-02")
                                  ->response("QUESTION_ID", "RESPONSE")
                                  ->send();
```

Please provide question identifiers for each field. A full list of question identifiers can be retrieved using [this helper method](#retrieving-question-identifiers-for-surveys)

#### Provide an unique identifier (recommended, optional)

[](#provide-an-unique-identifier-recommended-optional)

To ensure that you are not sending duplicate entries please provide some sort of identifier for that specific entry if you have in your system. This can be anything: order id, customer id, user id, etc.

```
$response = \Qualia\Submission\Entry::build($client)
                                  ->uniqueId("123")
                                  ...
                                  ->send();
```

#### Provide a language for entry (recommended, optional)

[](#provide-a-language-for-entry-recommended-optional)

If the survey has multiple languages enabled, you may set the language for an entry using below syntax depending on your website language.

```
$response = \Qualia\Submission\Entry::build($client)
                                  ...
                                  ->language("en")
                                  ->send();
```

If not provided, system will assign the default survey language. Be aware that if language provided is not in a list of survey languages, a default survey language will be assigned.

#### Allow duplicate emails

[](#allow-duplicate-emails)

By default, we will reject duplicate emails and throw an EmailExistsException. However, if you would like to allow duplicate emails to be submitted, you may call allowDuplicates() method. *Please ensure that you are not submitting duplicate emails too often as that will result in sending repeated emails to same email addresses.*

```
$response = \Qualia\Submission\Entry::build($client)
                                  ->allowDuplicates()
                                  ...
                                  ->send();
```

#### Retrieving question identifiers for surveys

[](#retrieving-question-identifiers-for-surveys)

If you are not sure what fields to provide, please retrieve a full list of questions used in the survey. Note: This will retrieve all questions available and usually you should only provide email, name, maybe a date of visit and other applicable fields that you already collect.

```
$questions = \Qualia\Configuration\Questions::get($client);

var_dump($questions);
/*
    [
        "surveys": [
            [ "name": "Enrollment Survey","key": "enrollment"],
            [ "name": "Initial Survey","key": "initial_survey"],
        ],
        [
            key: "QUESTION_ID",
            name: "Question Name"
            type: "Question Type",
            options: [
                OPTION_ID: "Option #1 name",
                OPTION_ID: "Option #2 name",
                ...
            ],
            help: "guidance which method to use"
        ],
        [
            key: "q_BFmVBf1TSb11xAU0",
            name: "What's your date of Visit?"
            type: "date",
            options: [ ],
            help: "use date("q_BFmVBf1TSb11xAU0", "2020-01-02") method in API Client. Date Value must be provided in Y-m-d."
        ],
        ...
    ]
*/

```

#### Full example

[](#full-example)

This is a full example of general configuration that will work in most cases. You will need to replace the strings in CAPITAL letters.

```
// Import library from composer
require __DIR__ . '/vendor/autoload.php';

// Initialize client
$client = new \Qualia\Client("YOUR_SURVEY_ID", "API_KEY");

try {
    // Create entry
    $response = \Qualia\Submission\Entry::build($client)
                                        ->uniqueId("SOME_ID")
                                        ->name("QUESTION_ID", "First Name", "Last Name")
                                        ->email("QUESTION_ID", "email@example.com")
                                        ->date("QUESTION_ID", "2020-01-02")
                                        ->response("QUESTION_ID", "RESPONSE")
                                        ->send();
} catch (\Qualia\Exceptions\ConnectionErrorException $e) {
    // unable to connect to server
} catch (\Qualia\Exceptions\EmailExistsException $e) {
    // echo $e->getEntryId();
    // The submitted email already exists in the server.
    // You may or may not need to handle this in your code..
    // By default, we are preventing duplicate submissions,
    // if you would like to submit it otherwise, call
    // allowDuplicates() method when building an entry
} catch (\Qualia\Exceptions\RequestException $e) {
    // some other unexpected error
    // echo $e->getMessage();
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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

Every ~48 days

Total

4

Last Release

3070d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94cb04668e8a6da8a0532d04ab34705c4fe3f319df00b273335c00ea508db0c0?d=identicon)[sakalauskas](/maintainers/sakalauskas)

---

Top Contributors

[![sakalauskas](https://avatars.githubusercontent.com/u/1455148?v=4)](https://github.com/sakalauskas "sakalauskas (26 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/qualiaanalytics-php-api/health.svg)

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

###  Alternatives

[cpriego/valet-linux

A more enjoyable local development experience for Linux.

1.5k135.9k](/packages/cpriego-valet-linux)[asana/asana

A PHP client for the Asana API

1381.6M4](/packages/asana-asana)[urbanairship/urbanairship

Urban Airship PHP Library

38606.2k2](/packages/urbanairship-urbanairship)[fab1en/rocket-chat-rest-client

Rocket Chat REST API client in PHP.

4983.1k](/packages/fab1en-rocket-chat-rest-client)[kontent-ai/delivery-sdk-php

Kontent.ai Delivery SDK for PHP

4628.8k](/packages/kontent-ai-delivery-sdk-php)[maksekeskus/maksekeskus-php

Maksekeskus PHP SDK

12179.8k](/packages/maksekeskus-maksekeskus-php)

PHPackages © 2026

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