{"id":38587514,"url":"https://github.com/esatisfaction/esat-php","last_synced_at":"2026-01-17T08:21:29.693Z","repository":{"id":37514797,"uuid":"184864655","full_name":"esatisfaction/esat-php","owner":"esatisfaction","description":"PHP library for the e-satisfaction API","archived":false,"fork":false,"pushed_at":"2023-04-19T19:10:53.000Z","size":84,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"v1.1","last_synced_at":"2025-01-04T23:48:18.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esatisfaction.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-1.1.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-04T07:22:25.000Z","updated_at":"2020-02-25T11:22:10.000Z","dependencies_parsed_at":"2022-08-19T05:21:21.602Z","dependency_job_id":null,"html_url":"https://github.com/esatisfaction/esat-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/esatisfaction/esat-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esatisfaction%2Fesat-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esatisfaction%2Fesat-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esatisfaction%2Fesat-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esatisfaction%2Fesat-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esatisfaction","download_url":"https://codeload.github.com/esatisfaction/esat-php/tar.gz/refs/heads/v1.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esatisfaction%2Fesat-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504363,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T08:21:29.608Z","updated_at":"2026-01-17T08:21:29.677Z","avatar_url":"https://github.com/esatisfaction.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# e-satisfaction Http Package\n\n[![Build Status](https://travis-ci.org/esatisfaction/esat-php.svg?branch=v1.0)](https://travis-ci.org/esatisfaction/esat-php)\n[![Latest Stable Version](https://poser.pugx.org/esatisfaction/esat-php/v/stable?format=flat-square)](https://packagist.org/packages/esatisfaction/esat-php)\n[![Total Downloads](https://poser.pugx.org/esatisfaction/esat-php/downloads?format=flat-square)](https://packagist.org/packages/esatisfaction/esat-php)\n[![License](https://poser.pugx.org/esatisfaction/esat-php/license?format=flat-square)](https://packagist.org/packages/esatisfaction/esat-php)\n\nPHP library for the e-satisfaction API\n\n## Requirements\n\nPHP 7.1.0 and later.\n\n## Composer\n\nYou can install the bindings via [Composer](http://getcomposer.org/). Run the following command:\n\n```bash\ncomposer require esatisfaction/esat-php\n```\n\nTo use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):\n\n```php\nrequire_once('vendor/autoload.php');\n```\n\n## Manual Installation\n\nIf you do not wish to use Composer, you can download the [latest release](https://github.com/esatisfaction/esat-php/releases). Then, to use the bindings, include the `init.php` file.\n\n```php\nrequire_once('/path/to/esatisfaction-php/init.php');\n```\n\n## Dependencies\n\nThis library require the following extensions and packages in order to work properly:\n\n- [`panda/config`](https://packagist.org/packages/panda/config)\n- [`panda/helpers`](https://packagist.org/packages/panda/helpers)\n- [`ramsey/uuid`](https://packagist.org/packages/ramsey/uuid)\n- [`symfony/http-foundation`](https://packagist.org/packages/symfony/http-foundation)\n- [`monolog/monolog`](https://packagist.org/packages/monolog/monolog)\n- [`php-http/guzzle6-adapter`](https://packagist.org/packages/php-http/guzzle6-adapter)\n- [`esatisfaction/http`](https://packagist.org/packages/esatisfaction/http)\n- [`symfony/cache`](https://packagist.org/packages/symfony/cache)\n\nIf you use Composer, these dependencies should be handled automatically.\nIf you install manually, you'll want to make sure that these extensions are available and loaded.\n \n## How do I start working with services?\n\nTo start working with the SDK, you have to initialize the following:\n\n* Setup the main Esat Registry\n* Set the Authorization Scheme to be used by each service's HttpClient\n\nExample:\n\n```php\nuse \\Esat\\Esat;\nuse \\Esat\\Auth\\TokenAuthProvider;\nuse \\Esat\\Http\\AuthClient;\nuse \\Monolog\\Logger;\n\n// Initialize Authentication\n$tokenAuthProvider = new TokenAuthProvider('YOUR_TOKEN', 'YOUR_DOMAIN');\n$httpClient = new AuthClient($tokenAuthProvider);\n\n// Initialize main Esatisfaction Registry\n$esatRegistry = new Esat();\n```\n\n### Questionnaires\n\nRead your questionnaires:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Questionnaire;\nuse \\Esat\\Support\\Model\\Propel\\FilterCriteria;\nuse \\Esat\\Support\\Model\\Propel\\Pagination;\nuse \\Monolog\\Logger;\n\n// Create Questionnaire Service\n$questionnaire = new Questionnaire($esatRegistry, new Logger(), $httpClient);\n\n// Load all questionnaires for my application\n$applicationId = '123';\n$filterCriteria = (new FilterCriteria())-\u003eequal('OwnerApplicationId', $applicationId);\n$pagination = (new Pagination())-\u003esetMaxPerPage(25)-\u003esetPage(1);\n$questionnairePager = $questionnaire-\u003egetList($filterCriteria, null, $pagination);\n\n// Read all questionnaires\nforeach ($questionnairePager-\u003egetQuestionnaires() as $questionnaireItem) {\n    // Get questionnaire display name\n    echo $questionnaireItem-\u003egetDisplayName();\n}\n\n// Load a questionnaire by id\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n    echo $questionnaireModel-\u003egetDisplayName();\n}\n```\n\n### Questionnaire Instances\n\nCreate a questionnaire instance and send the link to your customers:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Instances\\Questionnaire;\nuse \\Monolog\\Logger;\n\n// Create Questionnaire Service\n$questionnaire = new Questionnaire($esatRegistry, new Logger(), $httpClient);\n\n// Create questionnaire instance, with metadata\n$responderMetadata = [\n    'email' =\u003e 'john@doe.com',\n    'gender' =\u003e 'male'\n];\n$questionnaireMetadata = [\n    'transaction_id' =\u003e '12345asd',\n    'transaction_date' =\u003e '2019-05-03 14:12'\n];\nif ($questionnaire-\u003ecreate('YOUR_QUESTIONNAIRE_ID', [], $questionnaireMetadata, $responderMetadata)) {\n    // Get questionnaire collection url\n    $collectionUrl = $questionnaire-\u003egetQuestionnaire()-\u003egetCollectionUrl();\n    \n    // Send your email with the above url\n}\n```\n\nRead, Update or Delete Questionnaire Instances:\n\n**NOTICE**: This will cause data deletion and might alter your data. It will not affect your credits as the credits are reduced on questionnaire submit.\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Instances\\Questionnaire;\nuse \\Monolog\\Logger;\n\n// Create Questionnaire Service\n$questionnaire = new Questionnaire($esatRegistry, new Logger(), $httpClient);\n\n// Load a questionnaire instance\n// We always have to load the instance before performing an update or delete operation\n$instanceId = 'sadfewf2134d';\nif (!$questionnaire-\u003eload($instanceId)) {\n    // Handle error\n    echo 'Questionnaire instance Not Found';\n    die;\n}\n\n// Update the questionnaire instance\n$questionnaire-\u003egetQuestionnaire()-\u003esetLocale('el');\n$questionnaire-\u003egetQuestionnaire()-\u003esetValidDayes(50);\nif (!$questionnaire-\u003eupdate()) {\n    // Handle error\n    echo 'Questionnaire instance failed to be updated';\n    die;\n}\n\n// Load another questionnaire instance to delete\n// We always have to load the instance before performing an update or delete operation\n$instanceId = '23rteg34';\nif (!$questionnaire-\u003eload($instanceId)) {\n    // Handle error\n    echo 'Questionnaire instance Not Found';\n    die;\n}\n\n// Delete the questionnaire instance\nif (!$questionnaire-\u003edelete()) {\n    // Handle error\n    echo 'Questionnaire instance failed to be deleted';\n    die;\n}\n```\n\n### Pipelines\n\nRead your pipelines:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Pipeline;\nuse \\Monolog\\Logger;\n\n// Create Pipeline Service\n$pipeline = new Pipeline($esatRegistry, new Logger(), $httpClient);\n\n// Get all pipelines for a given questionnaire id\n$questionnaireId = 'asdf34rtefdfwe';\n$pipelines = $pipeline-\u003egetList($questionnaireId);\n\n// Read all pipelines\nforeach ($pipelines as $pipelineItem) {\n    // Get pipeline title\n    echo $pipelineItem-\u003egetTitle();\n}\n\n// Load a pipeline by id\nif ($pipeline-\u003eload('345uyjhg')) {\n    // Access pipeline data\n    $pipelineModel = $pipeline-\u003egetPipeline();\n    echo $pipelineModel-\u003egetTitle();\n}\n```\n\n### Queue Items\n\nAdd a queue item to allow e-satisfaction to send a survey:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Pipelines\\Queue;\nuse \\Monolog\\Logger;\n\n// Create Queue Service\n$queue = new Queue($esatRegistry, new Logger(), $httpClient);\n\n// Prepare queue item parameters\n$questionnaireId = 'asdf34rtefdfwe';\n$pipelineId = 'a09uherwgfd';\n$parameters = [\n    'responder_channel_identifier' =\u003e 'john@doe.com',\n    'send_time' =\u003e '2019-05-02 12:32',\n];\n\n// Create queue item\nif (!$queue-\u003ecreate($questionnaireId, $pipelineId, $parameters)) {\n    // Handle error\n    echo 'Queue item failed to be created. Error: ' . $queue-\u003egetErrorFromLastResponse();\n    die;\n}\n```\n\nRead, Update or Delete Queue Items:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Pipelines\\Queue;\nuse \\Monolog\\Logger;\n\n// Create Queue Service\n$queue = new Queue($esatRegistry, new Logger(), $httpClient);\n\n// Load a queue item\n// We always have to load the item before performing an update or delete operation\n$itemId = '9867w4wqrefd';\nif (!$queue-\u003eload($itemId)) {\n    // Handle error\n    echo 'Queue item Not Found';\n    die;\n}\n\n// Update the queue item\n$queue-\u003egetQueueItem()-\u003esetLocale('el');\n$queue-\u003egetQueueItem()-\u003esetSendTime('2019-06-03 14:32');\nif (!$queue-\u003eupdate()) {\n    // Handle error\n    echo 'Queue item failed to be updated';\n    die;\n}\n\n// Load another queue item to delete\n// We always have to load the item before performing an update or delete operation\n$itemId = '234rweg34';\nif (!$queue-\u003eload($itemId)) {\n    // Handle error\n    echo 'Queue item Not Found';\n    die;\n}\n\n// Delete the queue item\nif (!$queue-\u003edelete()) {\n    // Handle error\n    echo 'Queue item failed to be deleted';\n    die;\n}\n```\n\n### Handling Errors\n\nEach request stores the last response so that you can access it and get messages in case of errors.\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Questionnaire;\nuse \\Monolog\\Logger;\n\n// Create Questionnaire Service\n$questionnaire = new Questionnaire($esatRegistry, new Logger(), $httpClient);\n\n// Load a questionnaire by id\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n} else {\n    // Handle the error, get the http response code and error message, if any\n    $error = '';\n    switch ($questionnaire-\u003egetLastResponse()-\u003egetStatusCode()) {\n        case 500:\n            $error = 'An unexpected error occurred';\n            break;\n        case 404:\n            $error = 'Questionnaire Not Found';\n            break;\n        default:\n            $error = $questionnaire-\u003egetErrorFromLastResponse();\n    }\n    \n    // Display error\n    echo $error;\n}\n```\n\n### Caching\n\nThis library is using a default runtime caching mechanism that reduces API calls during runtime.\n\nThe caching mechanism is on service level and works only on READ requests and is being reset when a POST or PATCH method is called on the same service.\n\nIf you are trying to READ the same resource twice without any updates in between, the service will hit the cache and get the same result.\nYou can override the cache by calling `setCacheEnabled(false)` on the service before calling the method.\n\nExamples:\n\n```php\nuse \\Esat\\Services\\Questionnaires\\Questionnaire;\nuse \\Monolog\\Logger;\n\n// Create Questionnaire Service\n$questionnaire = new Questionnaire($esat, new Logger(), $httpClient);\n\n// DOES NOT hit cache\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n}\n\n// DOES hit cache\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n}\n\n// SKIP cache. From now on, all requests will skip cache.\n$questionnaire-\u003esetCacheEnabled(false);\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n}\n\n// Enable cache again to restore initial behavior. The following will DO hit cache\n$questionnaire-\u003esetCacheEnabled(true);\nif ($questionnaire-\u003eload('456sdfa')) {\n    // Access questionnaire data\n    $questionnaireModel = $questionnaire-\u003egetQuestionnaire();\n}\n```\n\n## Feedback\n\nThis is an open-source library for calling e-satisfaction API.\n\nFeel free to open Issues and Pull Requests to update it or fix bugs that you might find.\n\n## Code of Conduct Guidelines\n\nTake a look at the [Code of Conduct](CODE_OF_CONDUCT.md) document.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesatisfaction%2Fesat-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesatisfaction%2Fesat-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesatisfaction%2Fesat-php/lists"}